Merge "leds: qti-flash: set switch enabled state for precision control properly"
This commit is contained in:
commit
7ad63ac951
@ -799,7 +799,6 @@ static void qti_flash_led_switch_brightness_set(
|
||||
hrtimer_start(&snode->on_timer,
|
||||
ms_to_ktime(snode->on_time_ms),
|
||||
HRTIMER_MODE_REL);
|
||||
snode->enabled = state;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -841,6 +840,8 @@ static enum hrtimer_restart off_timer_function(struct hrtimer *timer)
|
||||
if (rc < 0)
|
||||
pr_err("Failed to disable flash LED switch %s, rc=%d\n",
|
||||
snode->cdev.name, rc);
|
||||
else
|
||||
snode->enabled = false;
|
||||
|
||||
return HRTIMER_NORESTART;
|
||||
}
|
||||
@ -856,6 +857,8 @@ static enum hrtimer_restart on_timer_function(struct hrtimer *timer)
|
||||
snode->enabled = false;
|
||||
pr_err("Failed to enable flash LED switch %s, rc=%d\n",
|
||||
snode->cdev.name, rc);
|
||||
} else {
|
||||
snode->enabled = true;
|
||||
}
|
||||
|
||||
return HRTIMER_NORESTART;
|
||||
|
Loading…
Reference in New Issue
Block a user