pwm: sysfs: Get return value from pwm_apply_state()
authorRyo Kodama <ryo.kodama.vz@renesas.com>
Wed, 8 Jun 2016 01:58:23 +0000 (10:58 +0900)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 10 Jun 2016 12:24:40 +0000 (14:24 +0200)
This patch adds to check the return value from pwm_apply_state()
used in enable_store(). The error of enable_store() doesn't work
if the return value doesn't received.

Signed-off-by: Ryo Kodama <ryo.kodama.vz@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fixes: 39100ceea79f ("pwm: Switch to the atomic API")
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/sysfs.c

index d98599249a05688137325fcf906415e14aa7aed4..01695d48dd543152624b9ed40a9c3afd9de45d0d 100644 (file)
@@ -152,7 +152,7 @@ static ssize_t enable_store(struct device *child,
                goto unlock;
        }
 
-       pwm_apply_state(pwm, &state);
+       ret = pwm_apply_state(pwm, &state);
 
 unlock:
        mutex_unlock(&export->lock);