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

Commit 7ed1d261 authored by David Collins's avatar David Collins
Browse files

regulator: spm-regulator: check spm status in probe function



Check the status of the spm driver using msm_spm_probe_done()
inside of the spm-regulator probe function.  Return any error
code from the probe function.  This ensures that spm-regulator
will defer its probe in the case that the spm driver has not
yet probed.

Change-Id: I6d006cee6289bd51e38271e70f81c7a4622016ee
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent c9b29ec5
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -480,6 +480,14 @@ static int spm_regulator_probe(struct spmi_device *spmi)
		return -ENODEV;
	}

	rc = msm_spm_probe_done();
	if (rc) {
		if (rc != -EPROBE_DEFER)
			dev_err(&spmi->dev, "%s: spm unavailable, rc=%d\n",
				__func__, rc);
		return rc;
	}

	vreg = devm_kzalloc(&spmi->dev, sizeof(*vreg), GFP_KERNEL);
	if (!vreg) {
		pr_err("allocation failed.\n");