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

Commit 528f859c authored by Tirupathi Reddy T's avatar Tirupathi Reddy T
Browse files

power: qpnp-linear-charger: fix of_property_read_bool() usage



The function of_property_read_bool() is used in the linear-charger
driver to test for the existence of non-boolean device tree properties.
These calls will work as expected; however, of_property_read_bool() is
only meant to be used for reading boolean device tree properties.

Replace the usage of of_property_read_bool() which test for
non-boolean property existence with of_find_property().

CRs-Fixed: 739482
Change-Id: I386644b619cbfc090dbf187dc241a3627afe7446
Signed-off-by: default avatarTirupathi Reddy T <tirupath@codeaurora.org>
parent 9ba5f614
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1653,7 +1653,7 @@ static int qpnp_lbc_chg_init(struct qpnp_lbc_chip *chip)
		return rc;
	}

	if (of_property_read_bool(chip->spmi->dev.of_node, "qcom,tchg-mins")) {
	if (of_find_property(chip->spmi->dev.of_node, "qcom,tchg-mins", NULL)) {
		rc = qpnp_lbc_tchg_max_set(chip, chip->cfg_tchg_mins);
		if (rc) {
			pr_err("Failed to set tchg_mins rc=%d\n", rc);