UPSTREAM: 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)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
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>
(cherry picked from commit fe5aa34d6eb9c4d34071845f70f3714b41c8a77d)

Change-Id: I550da28345bcee7a6aa8e1f9b5c43adae923ff2d
Signed-off-by: David Wu <david.wu@rock-chips.com>
drivers/pwm/sysfs.c

index 850ff5fa9e3817c4826f1064374054b98f3ea594..2cb39f17a54a716519c1c149f6e879efeb15551f 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);