diff options
author | Vaibhav Hiremath <vaibhav.hiremath@linaro.org> | 2016-02-22 17:27:24 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-23 22:43:06 -0800 |
commit | 599159b6877e665b086d6e3092203c651b8a3952 (patch) | |
tree | f83c0316df18b6ac4075f06a096b4b5ed0b02f14 /drivers/staging | |
parent | 27e18d8c6967f554b374a713c6bd21bcc985389b (diff) |
greybus: arche-platform: Return immediately if in same state from state change fns
Have a check inside all individual operational state change functions
to check whether device is in same state, and if yes, then return
immediately.
Testing Done: Tested on DB3.5 platform
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/greybus/arche-platform.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c index 591cf9dc5071..2dc11fdc5b88 100644 --- a/drivers/staging/greybus/arche-platform.c +++ b/drivers/staging/greybus/arche-platform.c @@ -133,6 +133,9 @@ static int arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdat { int ret; + if (arche_pdata->state == ARCHE_PLATFORM_STATE_ACTIVE) + return 0; + dev_info(arche_pdata->dev, "Booting from cold boot state\n"); svc_reset_onoff(arche_pdata->svc_reset_gpio, @@ -159,6 +162,9 @@ static int arche_platform_coldboot_seq(struct arche_platform_drvdata *arche_pdat static void arche_platform_fw_flashing_seq(struct arche_platform_drvdata *arche_pdata) { + if (arche_pdata->state == ARCHE_PLATFORM_STATE_FW_FLASHING) + return; + dev_info(arche_pdata->dev, "Switching to FW flashing state\n"); svc_reset_onoff(arche_pdata->svc_reset_gpio, @@ -176,6 +182,9 @@ static void arche_platform_fw_flashing_seq(struct arche_platform_drvdata *arche_ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pdata) { + if (arche_pdata->state == ARCHE_PLATFORM_STATE_OFF) + return; + /* Send disconnect/detach event to SVC */ gpio_set_value(arche_pdata->wake_detect_gpio, 0); usleep_range(100, 200); |