leds: qti-flash: Fix early return in qti_flash_led_disable()

When attempting to disable a flash node that is not configured, return
gracefully as it is not an error condition.

Change-Id: I3cf82eddc4ac078384a5278bd2832f7adceba853
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
This commit is contained in:
Guru Das Srinagesh 2020-08-10 13:56:46 -07:00 committed by David Collins
parent e1d79e321d
commit 4404a1a342

View File

@ -456,8 +456,10 @@ static int qti_flash_led_disable(struct flash_node_data *fnode)
struct qti_flash_led *led = fnode->led;
int rc;
if (!fnode->configured)
return -EINVAL;
if (!fnode->configured) {
pr_debug("%s is not configured\n", fnode->fdev.led_cdev.name);
return 0;
}
spin_lock(&led->lock);
if ((fnode->strobe_sel == HW_STROBE) &&