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

Commit bcad45cb authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Anirudh Ghayal
Browse files

power: smb135x-charger: fix dc path initialization



The driver tries to configure the dc path current even when
the dc type is not setup.

Fix this.

Change-Id: I636adbed988b4988fc2e90f57704ee1c8178e982
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 66619aa7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1775,14 +1775,13 @@ static int smb_parse_dt(struct smb135x_chg *chip)
		return -EINVAL;
	}

	chip->dc_psy_type = -EINVAL;
	dc_psy_type = of_get_property(node, "qcom,dc-psy-type", NULL);
	if (dc_psy_type) {
		if (strcmp(dc_psy_type, "Mains") == 0)
			chip->dc_psy_type = POWER_SUPPLY_TYPE_MAINS;
		else if (strcmp(dc_psy_type, "Wireless") == 0)
			chip->dc_psy_type = POWER_SUPPLY_TYPE_WIRELESS;
		else
			chip->dc_psy_type = -EINVAL;
	}

	if (chip->dc_psy_type != -EINVAL) {