提交 1f2bd227 编写于 作者: J Jarkko Nikula 提交者: Thierry Reding

pwm: Allow store 64-bit duty cycle from sysfs interface

PWM core was converted to u64 by the commit a9d887dc ("pwm: Convert
period and duty cycle to u64") but did not change the duty_cycle_store()
so it will error out if trying to pass a numeric string bigger than
2^32-1.

Fix this by using u64 and kstrtou64() in duty_cycle_store().
Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: NGuru Das Srinagesh <gurus@codeaurora.org>
Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 b39c0615
......@@ -87,10 +87,10 @@ static ssize_t duty_cycle_store(struct device *child,
struct pwm_export *export = child_to_pwm_export(child);
struct pwm_device *pwm = export->pwm;
struct pwm_state state;
unsigned int val;
u64 val;
int ret;
ret = kstrtouint(buf, 0, &val);
ret = kstrtou64(buf, 0, &val);
if (ret)
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册