浏览代码

pwm: sysfs: Remove unnecessary temporary variable

Use the result of pwm_is_enabled() directly instead of storing it in a
temporary variable.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Olliver Schinagl 9 年之前
父节点
当前提交
0344d0d69b
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/pwm/sysfs.c

+ 1 - 2
drivers/pwm/sysfs.c

@@ -97,9 +97,8 @@ static ssize_t pwm_enable_show(struct device *child,
 			       char *buf)
 {
 	const struct pwm_device *pwm = child_to_pwm_device(child);
-	int enabled = pwm_is_enabled(pwm);
 
-	return sprintf(buf, "%d\n", enabled);
+	return sprintf(buf, "%d\n", pwm_is_enabled(pwm));
 }
 
 static ssize_t pwm_enable_store(struct device *child,