From: Ryo Kodama Date: Wed, 8 Jun 2016 01:58:23 +0000 (+0900) Subject: UPSTREAM: pwm: sysfs: Get return value from pwm_apply_state() X-Git-Tag: firefly_0821_release~434 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9d523c146299c8c32204b1e94c664a3e18b8ad78;p=firefly-linux-kernel-4.4.55.git UPSTREAM: pwm: sysfs: Get return value from pwm_apply_state() 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 Signed-off-by: Yoshihiro Shimoda Fixes: 39100ceea79f ("pwm: Switch to the atomic API") Signed-off-by: Thierry Reding (cherry picked from commit fe5aa34d6eb9c4d34071845f70f3714b41c8a77d) Change-Id: I550da28345bcee7a6aa8e1f9b5c43adae923ff2d Signed-off-by: David Wu --- diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c index 850ff5fa9e38..2cb39f17a54a 100644 --- a/drivers/pwm/sysfs.c +++ b/drivers/pwm/sysfs.c @@ -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);