提交 cedd9dba 编写于 作者: C Chris Ruehl 提交者: Zheng Zengkai

phy: rockchip-emmc: emmc_phy_init() always return 0

stable inclusion
from stable-5.10.20
commit 95fdc1ea3bfc52f04508b5d7f0cf307604b3bcf9
bugzilla: 50608

--------------------------------

[ Upstream commit 39961bd6 ]

rockchip_emmc_phy_init() return variable is not set with the error value
if clk_get() failed. 'emmcclk' is optional, thus use clk_get_optional()
and if the return value != NULL make error processing and set the
return code accordingly.

Fixes: 52c0624a phy: rockchip-emmc: Set phyctrl_frqsel based on card clock
Signed-off-by: NChris Ruehl <chris.ruehl@gtsys.com.hk>
Reviewed-by: NDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20201210080454.17379-1-chris.ruehl@gtsys.com.hkSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8ac2dcd4
......@@ -240,15 +240,17 @@ static int rockchip_emmc_phy_init(struct phy *phy)
* - SDHCI driver to get the PHY
* - SDHCI driver to init the PHY
*
* The clock is optional, so upon any error we just set to NULL.
* The clock is optional, using clk_get_optional() to get the clock
* and do error processing if the return value != NULL
*
* NOTE: we don't do anything special for EPROBE_DEFER here. Given the
* above expected use case, EPROBE_DEFER isn't sensible to expect, so
* it's just like any other error.
*/
rk_phy->emmcclk = clk_get(&phy->dev, "emmcclk");
rk_phy->emmcclk = clk_get_optional(&phy->dev, "emmcclk");
if (IS_ERR(rk_phy->emmcclk)) {
dev_dbg(&phy->dev, "Error getting emmcclk: %d\n", ret);
ret = PTR_ERR(rk_phy->emmcclk);
dev_err(&phy->dev, "Error getting emmcclk: %d\n", ret);
rk_phy->emmcclk = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册