aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/ufs/ufshcd.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 5d60a868830d..2aa85e398f76 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4225,22 +4225,15 @@ static struct scsi_host_template ufshcd_driver_template = {
4225static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg, 4225static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg,
4226 int ua) 4226 int ua)
4227{ 4227{
4228 int ret = 0; 4228 int ret;
4229 struct regulator *reg = vreg->reg;
4230 const char *name = vreg->name;
4231 4229
4232 BUG_ON(!vreg); 4230 if (!vreg)
4231 return 0;
4233 4232
4234 ret = regulator_set_optimum_mode(reg, ua); 4233 ret = regulator_set_load(vreg->reg, ua);
4235 if (ret >= 0) { 4234 if (ret < 0) {
4236 /* 4235 dev_err(dev, "%s: %s set load (ua=%d) failed, err=%d\n",
4237 * regulator_set_optimum_mode() returns new regulator 4236 __func__, vreg->name, ua, ret);
4238 * mode upon success.
4239 */
4240 ret = 0;
4241 } else {
4242 dev_err(dev, "%s: %s set optimum mode(ua=%d) failed, err=%d\n",
4243 __func__, name, ua, ret);
4244 } 4237 }
4245 4238
4246 return ret; 4239 return ret;
@@ -4249,18 +4242,12 @@ static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg,
4249static inline int ufshcd_config_vreg_lpm(struct ufs_hba *hba, 4242static inline int ufshcd_config_vreg_lpm(struct ufs_hba *hba,
4250 struct ufs_vreg *vreg) 4243 struct ufs_vreg *vreg)
4251{ 4244{
4252 if (!vreg)
4253 return 0;
4254
4255 return ufshcd_config_vreg_load(hba->dev, vreg, UFS_VREG_LPM_LOAD_UA); 4245 return ufshcd_config_vreg_load(hba->dev, vreg, UFS_VREG_LPM_LOAD_UA);
4256} 4246}
4257 4247
4258static inline int ufshcd_config_vreg_hpm(struct ufs_hba *hba, 4248static inline int ufshcd_config_vreg_hpm(struct ufs_hba *hba,
4259 struct ufs_vreg *vreg) 4249 struct ufs_vreg *vreg)
4260{ 4250{
4261 if (!vreg)
4262 return 0;
4263
4264 return ufshcd_config_vreg_load(hba->dev, vreg, vreg->max_uA); 4251 return ufshcd_config_vreg_load(hba->dev, vreg, vreg->max_uA);
4265} 4252}
4266 4253