From ec2cf0ad13a2a048c0a792a6d2352c96012db82c Mon Sep 17 00:00:00 2001 From: Guru Das Srinagesh Date: Mon, 13 Jul 2020 19:02:34 -0700 Subject: [PATCH] leds: qti-flash: Allow symmetrical switch on with no channels configured Currently, with LED symmetry enabled, turning on a switch without configuring current in a channel first results in errors being seen. Without LED symmetry enabled, the same action results only in qti_flash_led_strobe() being called with the value argument set to zero. Bring about the same behaviour for LED symmetry as well. Change-Id: I2d6301ec3cc19d89acbd0545509485866ffa9085 Signed-off-by: Guru Das Srinagesh --- drivers/leds/leds-qti-flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-qti-flash.c b/drivers/leds/leds-qti-flash.c index 790a2dc81f2b..cf7ef0c8a7d4 100644 --- a/drivers/leds/leds-qti-flash.c +++ b/drivers/leds/leds-qti-flash.c @@ -522,8 +522,8 @@ static int qti_flash_led_symmetry_config( } if (type == FLASH_LED_TYPE_UNKNOWN) { - pr_err("Error in symmetry configuration for switch device\n"); - return -EINVAL; + /* No channels are configured */ + return 0; } for (i = 0; i < led->num_fnodes; i++) {