Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: mmp: Fix deferred clk handling in mmphw_probe()
@ 2023-04-13 19:33 Christophe JAILLET
  2023-04-15 13:09 ` Dan Carpenter
  2023-04-22  9:41 ` Helge Deller
  0 siblings, 2 replies; 5+ messages in thread
From: Christophe JAILLET @ 2023-04-13 19:33 UTC (permalink / raw)
  To: Helge Deller, Cai Huoqing
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-fbdev,
	dri-devel

When dev_err_probe() is called, 'ret' holds the value of the previous
successful devm_request_irq() call.
'ret' should be assigned with a meaningful value before being used in
dev_err_probe().

While at it, use and return "PTR_ERR(ctrl->clk)" instead of a hard-coded
"-ENOENT" so that -EPROBE_DEFER is handled and propagated correctly.

Fixes: 81b63420564d ("video: fbdev: mmp: Make use of the helper function dev_err_probe()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
index a9df8ee79810..51fbf02a0343 100644
--- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
+++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c
@@ -514,9 +514,9 @@ static int mmphw_probe(struct platform_device *pdev)
 	/* get clock */
 	ctrl->clk = devm_clk_get(ctrl->dev, mi->clk_name);
 	if (IS_ERR(ctrl->clk)) {
+		ret = PTR_ERR(ctrl->clk);
 		dev_err_probe(ctrl->dev, ret,
 			      "unable to get clk %s\n", mi->clk_name);
-		ret = -ENOENT;
 		goto failed;
 	}
 	clk_prepare_enable(ctrl->clk);
-- 
2.34.1


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

end of thread, other threads:[~2023-04-22  9:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-13 19:33 [PATCH] video: fbdev: mmp: Fix deferred clk handling in mmphw_probe() Christophe JAILLET
2023-04-15 13:09 ` Dan Carpenter
2023-04-19  4:59   ` Dan Carpenter
2023-04-19  5:28     ` Christophe JAILLET
2023-04-22  9:41 ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox