linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-emmc: emmc_phy_init() always return 0
@ 2020-12-01  3:10 Chris Ruehl
  2020-12-01 16:05 ` Doug Anderson
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Ruehl @ 2020-12-01  3:10 UTC (permalink / raw)
  Cc: Chris Ruehl, Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner,
	Douglas Anderson, Ulf Hansson, linux-kernel, linux-arm-kernel,
	linux-rockchip

rockchip_emmc_phy_init() return variable is not set with the error value
if clk_get() failed. The debug message print 0 on error and the function
always return 0.
Fix it using PTR_ERR().

Fixes: 52c0624a10cce phy: rockchip-emmc: Set phyctrl_frqsel based on card clock

Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
---
 drivers/phy/rockchip/phy-rockchip-emmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/phy/rockchip/phy-rockchip-emmc.c b/drivers/phy/rockchip/phy-rockchip-emmc.c
index 48e2d75b1004..75faee5c0d27 100644
--- a/drivers/phy/rockchip/phy-rockchip-emmc.c
+++ b/drivers/phy/rockchip/phy-rockchip-emmc.c
@@ -253,6 +253,7 @@ static int rockchip_emmc_phy_init(struct phy *phy)
 	 */
 	rk_phy->emmcclk = clk_get(&phy->dev, "emmcclk");
 	if (IS_ERR(rk_phy->emmcclk)) {
+		ret = PTR_ERR(rk_phy->emmcclk);
 		dev_dbg(&phy->dev, "Error getting emmcclk: %d\n", ret);
 		rk_phy->emmcclk = NULL;
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-04 17:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01  3:10 [PATCH] phy: rockchip-emmc: emmc_phy_init() always return 0 Chris Ruehl
2020-12-01 16:05 ` Doug Anderson
2020-12-02  8:36   ` Chris Ruehl
2020-12-04  3:01     ` Chris Ruehl
2020-12-04 17:53       ` Doug Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).