diff mbox series

[v2,3/4] scsi: ufs: change "<name>-max-microamp" to non-mandatory property

Message ID 1552641974-30672-5-git-send-email-stanley.chu@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] scsi: ufs: remove unused min_uA field in struct ufs_vreg | expand

Commit Message

Stanley Chu March 15, 2019, 9:26 a.m. UTC
In some platforms, vcc, vccq and vccq2 regulators may not need
to define their current limit but need to define their voltage
range for correct regulator_set_voltage behaviors.

However, missing "<name>-max-microamp" property in device tree
will lead to initialization fail. This limitation shall be
resolved to tolerate such kind of regulators.

Because we do bypass regulator_set_load operations in case
current limit is undefined, so this change shall be safe.

Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
 drivers/scsi/ufs/ufshcd-pltfrm.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 588079286e8a..2f244d388ca8 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -157,11 +157,9 @@  static int ufshcd_populate_vreg(struct device *dev, const char *name,
 		goto out;
 
 	snprintf(prop_name, MAX_PROP_SIZE, "%s-max-microamp", name);
-	ret = of_property_read_u32(np, prop_name, &vreg->max_uA);
-	if (ret) {
-		dev_err(dev, "%s: unable to find %s err %d\n",
-				__func__, prop_name, ret);
-		goto out;
+	if (of_property_read_u32(np, prop_name, &vreg->max_uA)) {
+		dev_info(dev, "%s: unable to find %s\n", __func__, prop_name);
+		vreg->max_uA = 0;
 	}
 
 	if (!strcmp(name, "vcc")) {