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

Commit 65fdb6e2 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

leds: qpnp-flash-v2: Return zero when parsing optional DT parameters fails



While parsing optional DT properties in the helper functions,
return 0 at the end of the function to ensure that there is not
an actual error.

While at it, print rc value when qpnp_flash_led_parse_common_dt()
fails.

Change-Id: I8f5ffddcd7794e667a7e860abd1b2bbc5b7b05dc
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent e76a4c58
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2118,7 +2118,7 @@ static int qpnp_flash_led_parse_thermal_config_dt(struct qpnp_flash_led *led,
		return rc;
	}

	return rc;
	return 0;
}

static int qpnp_flash_led_parse_vph_droop_config_dt(struct qpnp_flash_led *led,
@@ -2174,7 +2174,7 @@ static int qpnp_flash_led_parse_vph_droop_config_dt(struct qpnp_flash_led *led,
	}

	led->pdata->vph_droop_hysteresis <<= FLASH_LED_VPH_DROOP_HYST_SHIFT;
	return rc;
	return 0;
}

static int qpnp_flash_led_parse_iclamp_config_dt(struct qpnp_flash_led *led,
@@ -2215,7 +2215,7 @@ static int qpnp_flash_led_parse_iclamp_config_dt(struct qpnp_flash_led *led,
		return rc;
	}

	return rc;
	return 0;
}

static int qpnp_flash_led_parse_lmh_config_dt(struct qpnp_flash_led *led,
@@ -2267,7 +2267,7 @@ static int qpnp_flash_led_parse_lmh_config_dt(struct qpnp_flash_led *led,
		return -EINVAL;
	}

	return rc;
	return 0;
}

static int qpnp_flash_led_parse_common_dt(struct qpnp_flash_led *led,
@@ -2522,7 +2522,8 @@ static int qpnp_flash_led_probe(struct platform_device *pdev)

	rc = qpnp_flash_led_parse_common_dt(led, node);
	if (rc < 0) {
		pr_err("Failed to parse common flash LED device tree\n");
		pr_err("Failed to parse common flash LED device tree rc=%d\n",
			rc);
		return rc;
	}