提交 9a26a84e 编写于 作者: J Johan Hovold 提交者: Linus Torvalds

backlight: atmel-pwm-bl: clean up get_intensity

Clean up get_intensity to increase readability.
Signed-off-by: NJohan Hovold <jhovold@gmail.com>
Acked-by: NJingoo Han <jg1.han@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ce726c97
...@@ -70,15 +70,14 @@ static int atmel_pwm_bl_set_intensity(struct backlight_device *bd) ...@@ -70,15 +70,14 @@ static int atmel_pwm_bl_set_intensity(struct backlight_device *bd)
static int atmel_pwm_bl_get_intensity(struct backlight_device *bd) static int atmel_pwm_bl_get_intensity(struct backlight_device *bd)
{ {
struct atmel_pwm_bl *pwmbl = bl_get_data(bd); struct atmel_pwm_bl *pwmbl = bl_get_data(bd);
u32 cdty;
u32 intensity; u32 intensity;
if (pwmbl->pdata->pwm_active_low) { cdty = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY);
intensity = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY) - if (pwmbl->pdata->pwm_active_low)
pwmbl->pdata->pwm_duty_min; intensity = cdty - pwmbl->pdata->pwm_duty_min;
} else { else
intensity = pwmbl->pdata->pwm_duty_max - intensity = pwmbl->pdata->pwm_duty_max - cdty;
pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY);
}
return intensity & 0xffff; return intensity & 0xffff;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册