Skip to content

Commit 2ff6365

Browse files
petegriffinvinodkoul
authored andcommitted
phy: samsung-ufs: ufs: exit on first reported error
To preserve the err value, exit the loop immediately if an error is returned. Fixes: f2c6d0f ("phy: samsung-ufs: use exynos_get_pmu_regmap_by_phandle() to obtain PMU regmap") Signed-off-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8b19c45 commit 2ff6365

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/phy/samsung/phy-samsung-ufs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,18 @@ static int samsung_ufs_phy_calibrate(struct phy *phy)
9999

100100
for_each_phy_lane(ufs_phy, i) {
101101
if (ufs_phy->ufs_phy_state == CFG_PRE_INIT &&
102-
ufs_phy->drvdata->wait_for_cal)
102+
ufs_phy->drvdata->wait_for_cal) {
103103
err = ufs_phy->drvdata->wait_for_cal(phy, i);
104+
if (err)
105+
goto out;
106+
}
104107

105108
if (ufs_phy->ufs_phy_state == CFG_POST_PWR_HS &&
106-
ufs_phy->drvdata->wait_for_cdr)
109+
ufs_phy->drvdata->wait_for_cdr) {
107110
err = ufs_phy->drvdata->wait_for_cdr(phy, i);
111+
if (err)
112+
goto out;
113+
}
108114
}
109115

110116
/**

0 commit comments

Comments
 (0)