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

Commit cc9fa2c2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb135x: fix parallel mode i2c errors from incorrect check"

parents b73d56ac ba295c90
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1727,13 +1727,6 @@ static int smb135x_parallel_set_chg_present(struct smb135x_chg *chip,
	u8 val;
	int rc;

	/* Check if SMB135x is present */
	rc = smb135x_read(chip, VERSION1_REG, &val);
	if (rc) {
		pr_debug("Failed to detect smb135x-parallel charger may be absent\n");
		return -ENODEV;
	}

	if (present == chip->parallel_charger_present) {
		pr_debug("present %d -> %d, skipping\n",
				chip->parallel_charger_present, present);
@@ -1741,6 +1734,13 @@ static int smb135x_parallel_set_chg_present(struct smb135x_chg *chip,
	}

	if (present) {
		/* Check if SMB135x is present */
		rc = smb135x_read(chip, VERSION1_REG, &val);
		if (rc) {
			pr_debug("Failed to detect smb135x-parallel charger may be absent\n");
			return -ENODEV;
		}

		rc = smb135x_enable_volatile_writes(chip);
		if (rc < 0) {
			dev_err(chip->dev,