Hi,
This series simply cleans up UFS vops and shall not change any functionality.
Stanley Chu (4):
scsi: ufs: Remove unused setup_regulators variant function
scsi: ufs: Introduce phy_initialization helper
scsi: ufs-cdns: Use phy_initialization helper
scsi: ufs-dwc: Use phy_initialization helper
drivers/scsi/ufs/cdns-pltfrm.c | 3 +--
drivers/scsi/ufs/ufshcd-dwc.c | 11 ++++-------
drivers/scsi/ufs/ufshcd.c | 10 +---------
drivers/scsi/ufs/ufshcd.h | 18 ++++++++----------
4 files changed, 14 insertions(+), 28 deletions(-)
--
2.18.0
Use phy_initialization helper instead of direct function invoking.
Reviewed-by: Avri Altman <[email protected]>
Signed-off-by: Stanley Chu <[email protected]>
---
drivers/scsi/ufs/cdns-pltfrm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/ufs/cdns-pltfrm.c b/drivers/scsi/ufs/cdns-pltfrm.c
index da065a259f6e..149391faa19c 100644
--- a/drivers/scsi/ufs/cdns-pltfrm.c
+++ b/drivers/scsi/ufs/cdns-pltfrm.c
@@ -221,8 +221,7 @@ static int cdns_ufs_init(struct ufs_hba *hba)
return -ENOMEM;
ufshcd_set_variant(hba, host);
- if (hba->vops && hba->vops->phy_initialization)
- status = hba->vops->phy_initialization(hba);
+ status = ufshcd_vops_phy_initialization(hba);
return status;
}
--
2.18.0
Introduce phy_initialization helper since this is the only
one variant function without helper.
Reviewed-by: Avri Altman <[email protected]>
Signed-off-by: Stanley Chu <[email protected]>
---
drivers/scsi/ufs/ufshcd.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 21de7607611f..384a042ccb46 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -1134,6 +1134,14 @@ static inline int ufshcd_vops_link_startup_notify(struct ufs_hba *hba,
return 0;
}
+static inline int ufshcd_vops_phy_initialization(struct ufs_hba *hba)
+{
+ if (hba->vops && hba->vops->phy_initialization)
+ return hba->vops->phy_initialization(hba);
+
+ return 0;
+}
+
static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba,
bool status,
struct ufs_pa_layer_attr *dev_max_params,
--
2.18.0
Use phy_initialization helper instead of direct invoking.
Reviewed-by: Avri Altman <[email protected]>
Signed-off-by: Stanley Chu <[email protected]>
---
drivers/scsi/ufs/ufshcd-dwc.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd-dwc.c b/drivers/scsi/ufs/ufshcd-dwc.c
index 6a901da2d15a..5bb9d3a88795 100644
--- a/drivers/scsi/ufs/ufshcd-dwc.c
+++ b/drivers/scsi/ufs/ufshcd-dwc.c
@@ -120,13 +120,10 @@ int ufshcd_dwc_link_startup_notify(struct ufs_hba *hba,
if (status == PRE_CHANGE) {
ufshcd_dwc_program_clk_div(hba, DWC_UFS_REG_HCLKDIV_DIV_125);
- if (hba->vops->phy_initialization) {
- err = hba->vops->phy_initialization(hba);
- if (err) {
- dev_err(hba->dev, "Phy setup failed (%d)\n",
- err);
- goto out;
- }
+ err = ufshcd_vops_phy_initialization(hba);
+ if (err) {
+ dev_err(hba->dev, "Phy setup failed (%d)\n", err);
+ goto out;
}
} else { /* POST_CHANGE */
err = ufshcd_dwc_link_is_up(hba);
--
2.18.0
Stanley,
> This series simply cleans up UFS vops and shall not change any
> functionality.
Applied to 5.11/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
On Sat, 5 Dec 2020 20:00:37 +0800, Stanley Chu wrote:
> This series simply cleans up UFS vops and shall not change any functionality.
>
> Stanley Chu (4):
> scsi: ufs: Remove unused setup_regulators variant function
> scsi: ufs: Introduce phy_initialization helper
> scsi: ufs-cdns: Use phy_initialization helper
> scsi: ufs-dwc: Use phy_initialization helper
>
> [...]
Applied to 5.11/scsi-queue, thanks!
[1/4] scsi: ufs: Remove unused setup_regulators variant function
https://git.kernel.org/mkp/scsi/c/ade921a891de
[2/4] scsi: ufs: Introduce phy_initialization helper
https://git.kernel.org/mkp/scsi/c/92bcebe4b6d6
[3/4] scsi: ufs-cdns: Use phy_initialization helper
https://git.kernel.org/mkp/scsi/c/885445736bc0
[4/4] scsi: ufs-dwc: Use phy_initialization helper
https://git.kernel.org/mkp/scsi/c/ab98105484fc
--
Martin K. Petersen Oracle Linux Engineering