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>
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;
}
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)