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

Commit f4f4d0a3 authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

leds: qpnp-wled: Fix the string compare operation for dim_mode



The dim_mode value via sysfs carries a new-line character. Use
the correct string to compare.

CRs-Fixed: 1093371
Change-Id: I02f75e32880dc807977db0667062b047237a9b0d
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 4fa286af
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -683,9 +683,9 @@ static ssize_t qpnp_wled_dim_mode_store(struct device *dev,
	if (snprintf(str, QPNP_WLED_STR_SIZE, "%s", buf) > QPNP_WLED_STR_SIZE)
		return -EINVAL;

	if (strcmp(str, "analog") == 0)
	if (strcmp(str, "analog\n") == 0)
		temp = QPNP_WLED_DIM_ANALOG;
	else if (strcmp(str, "digital") == 0)
	else if (strcmp(str, "digital\n") == 0)
		temp = QPNP_WLED_DIM_DIGITAL;
	else
		temp = QPNP_WLED_DIM_HYBRID;