]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
drivers: ufs: add helper for phy_initialization callback
authorJulien Stephan <jstephan@baylibre.com>
Thu, 5 Mar 2026 08:49:03 +0000 (09:49 +0100)
committerNeil Armstrong <neil.armstrong@linaro.org>
Thu, 5 Mar 2026 15:51:51 +0000 (16:51 +0100)
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 <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260305-ufs-ufs_hba_ops-cleanup-v3-2-e153ffab98f5@baylibre.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/ufs/ufs-rockchip.c
drivers/ufs/ufs.h

index 0384244387da800123539d94e6b86afd8af758f7..8ce3c269cf7735878c74ce62336a2fd4131a4bdb 100644 (file)
@@ -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;
 }
index bc839a437045d45f94906af7d223bacd37c8c26c..74125b1ab31b606d217978408e9968e085b9ec75 100644 (file)
@@ -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)