Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 407f4bd2 authored by Abinaya P's avatar Abinaya P
Browse files

leds: leds-qpnp: check if flash_wa regulator is obtained before enabling



The flash led requires the use of an optional regulator, "flash_wa_reg".
This regulator is enabled without checking if the regulator is obtained
or not. Hence, a check is made before enabling/disabing the regulator to
ensure that the "flash_wa_reg" is obtained first.

Change-Id: I8fda00274ad3bc21d9ed32d0f3f2ca09e1079f87
Signed-off-by: default avatarAbinaya P <abinayap@codeaurora.org>
parent 222660dd
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -3131,9 +3131,10 @@ static int qpnp_get_config_flash(struct qpnp_led_data *led,
					"Flash wa regulator get failed(%d)\n",
					rc);
			}
		}
		} else {
			led->flash_cfg->flash_wa_reg_get = true;
		}
	}

	if (led->id == QPNP_ID_FLASH1_LED0) {
		led->flash_cfg->enable_module = FLASH_ENABLE_LED_0;