Commit 9a26a84e authored by Johan Hovold's avatar Johan Hovold Committed by Linus Torvalds

backlight: atmel-pwm-bl: clean up get_intensity

Clean up get_intensity to increase readability.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Acked-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ce726c97
......@@ -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)
{
struct atmel_pwm_bl *pwmbl = bl_get_data(bd);
u32 cdty;
u32 intensity;
if (pwmbl->pdata->pwm_active_low) {
intensity = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY) -
pwmbl->pdata->pwm_duty_min;
} else {
intensity = pwmbl->pdata->pwm_duty_max -
pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY);
}
cdty = pwm_channel_readl(&pwmbl->pwmc, PWM_CDTY);
if (pwmbl->pdata->pwm_active_low)
intensity = cdty - pwmbl->pdata->pwm_duty_min;
else
intensity = pwmbl->pdata->pwm_duty_max - cdty;
return intensity & 0xffff;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment