summaryrefslogtreecommitdiffstats
path: root/drivers/ufs
diff options
context:
space:
mode:
authorKeoseong Park <keosung.park@samsung.com>2022-10-28 09:35:53 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2022-11-08 03:55:31 +0100
commitbc77fb9ce40c276cedf889dca2bc6d1b1edc2763 (patch)
tree22f9eec9e449e709ff75bec83679bc548ae392e5 /drivers/ufs
parentscsi: MAINTAINERS: Make Xiang Chen HiSilicon SAS controller driver maintainer (diff)
downloadlinux-bc77fb9ce40c276cedf889dca2bc6d1b1edc2763.tar.xz
linux-bc77fb9ce40c276cedf889dca2bc6d1b1edc2763.zip
scsi: ufs: core: Refactor ufshcd_hba_enable()
Use "if error return" style in ufshcd_hba_enable(). No functional change. Cc: Bart Van Assche <bvanassche@acm.org> Cc: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Keoseong Park <keosung.park@samsung.com> Link: https://lore.kernel.org/r/20221028073553epcms2p6dc4f8bdbebdc8f96f43fc4197b3edd0c@epcms2p6 Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs')
-rw-r--r--drivers/ufs/core/ufshcd.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index ee73d7036133..0591d05c078a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -4668,14 +4668,18 @@ int ufshcd_hba_enable(struct ufs_hba *hba)
/* enable UIC related interrupts */
ufshcd_enable_intr(hba, UFSHCD_UIC_MASK);
ret = ufshcd_dme_reset(hba);
- if (!ret) {
- ret = ufshcd_dme_enable(hba);
- if (!ret)
- ufshcd_vops_hce_enable_notify(hba, POST_CHANGE);
- if (ret)
- dev_err(hba->dev,
- "Host controller enable failed with non-hce\n");
+ if (ret) {
+ dev_err(hba->dev, "DME_RESET failed\n");
+ return ret;
}
+
+ ret = ufshcd_dme_enable(hba);
+ if (ret) {
+ dev_err(hba->dev, "Enabling DME failed\n");
+ return ret;
+ }
+
+ ufshcd_vops_hce_enable_notify(hba, POST_CHANGE);
} else {
ret = ufshcd_hba_execute_hce(hba);
}