diff mbox series

[v2,4/4] scsi: ufs: remove "<name>-fixed-regulator" device tree property

Message ID 1552641974-30672-6-git-send-email-stanley.chu@mediatek.com (mailing list archive)
State Superseded
Headers show
Series scsi: ufs: fix regulator operations and remove "<name>-fixed-regulator" device tree property | expand

Commit Message

Stanley Chu March 15, 2019, 9:26 a.m. UTC
"<name>-fixed-regulator" device tree property can be
safely removed because below things are fixed or resolved,

- "<name>-max-microamp" becomes optional property: Undefined
  "<name>-max-microamp" will not cause initialization fail.

- regulator_set_load operation now has rules: Only those regulators
  which have configured current limit from "<name>-max-microamp"
  property is allowed to change its load.

The difference of regulators which define "<name>-fixed-regulator"
or not is listed as below,

- "<name>-max-microamp": If an existed regulator which defined
  "<name>-fixed-regulator", it shall be lack of "<name>-max-microamp"
  property in device tree thus regulator_set_load behaviors will be
  the same as before this patch.

- "vcc-supply-1p8": This only impacts "vcc-supply" regulator. However
  vcc shall not define "<name>-fixed-regulator" in device tree
  otherwise ufshcd_config_vreg() will use zero voltage values as
  request to regulator_set_voltage() and may lead to unexpected
  results.

Therefore this patch is safe for all existed regulators with
"<name>-fixed-regulator" property already used.

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

Patch

diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
index 2f244d388ca8..a667e7ba1c8b 100644
--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
+++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
@@ -151,11 +151,6 @@  static int ufshcd_populate_vreg(struct device *dev, const char *name,
 
 	vreg->name = kstrdup(name, GFP_KERNEL);
 
-	/* if fixed regulator no need further initialization */
-	snprintf(prop_name, MAX_PROP_SIZE, "%s-fixed-regulator", name);
-	if (of_property_read_bool(np, prop_name))
-		goto out;
-
 	snprintf(prop_name, MAX_PROP_SIZE, "%s-max-microamp", name);
 	if (of_property_read_u32(np, prop_name, &vreg->max_uA)) {
 		dev_info(dev, "%s: unable to find %s\n", __func__, prop_name);