Merge "leds: qti-flash: set switch enabled state for precision control properly"

This commit is contained in:
qctecmdr 2022-06-27 01:19:06 -07:00 committed by Gerrit - the friendly Code Review server
commit 7ad63ac951

View File

@ -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;