diff options
| author | Julien Stephan <[email protected]> | 2026-03-05 09:49:03 +0100 |
|---|---|---|
| committer | Neil Armstrong <[email protected]> | 2026-03-05 16:51:51 +0100 |
| commit | aa1b3f2583f14d2ecf7d5c455f1500790e3bcdf2 (patch) | |
| tree | 717f1e8c9b10fb996ea7c3b4e43a7b3f4885279d /drivers | |
| parent | 0bb1d511e4f5deb4e8426ba2c8fc8f4859999341 (diff) | |
drivers: ufs: add helper for phy_initialization callback
Introduce ufshcd_ops_phy_initialization() as a helper for invoking the
phy_initialization callback from ufs_hba_ops.
This mirrors the existing helper pattern used for other ufs_hba_ops
callbacks and keeps the call sites consistent and easier to maintain.
Signed-off-by: Julien Stephan <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/ufs/ufs-rockchip.c | 9 | ||||
| -rw-r--r-- | drivers/ufs/ufs.h | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/drivers/ufs/ufs-rockchip.c b/drivers/ufs/ufs-rockchip.c index 0384244387d..8ce3c269cf7 100644 --- a/drivers/ufs/ufs-rockchip.c +++ b/drivers/ufs/ufs-rockchip.c @@ -30,12 +30,9 @@ static int ufs_rockchip_hce_enable_notify(struct ufs_hba *hba, ufshcd_dme_reset(hba); ufshcd_dme_enable(hba); - if (hba->ops->phy_initialization) { - err = hba->ops->phy_initialization(hba); - if (err) - dev_err(hba->dev, - "Phy init failed (%d)\n", err); - } + err = ufshcd_ops_phy_initialization(hba); + if (err) + dev_err(hba->dev, "Phy init failed (%d)\n", err); return err; } diff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h index bc839a43704..74125b1ab31 100644 --- a/drivers/ufs/ufs.h +++ b/drivers/ufs/ufs.h @@ -756,6 +756,14 @@ static inline int ufshcd_ops_link_startup_notify(struct ufs_hba *hba, return 0; } +static inline int ufshcd_ops_phy_initialization(struct ufs_hba *hba) +{ + if (hba->ops && hba->ops->phy_initialization) + return hba->ops->phy_initialization(hba); + + return 0; +} + static inline int ufshcd_vops_device_reset(struct ufs_hba *hba) { if (hba->ops && hba->ops->device_reset) |
