All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: raspberrypi: Use dev_err_probe() to simplify code
@ 2022-09-24  2:50 Yuan Can
  2022-09-25 17:51 ` Florian Fainelli
  0 siblings, 1 reply; 2+ messages in thread
From: Yuan Can @ 2022-09-24  2:50 UTC (permalink / raw)
  To: f.fainelli, bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel
  Cc: yuancan

In the probe path, dev_err() can be replaced with dev_err_probe()
which will check if error code is -EPROBE_DEFER and prints the
error name. It also sets the defer probe reason which can be
checked later through debugfs.

Signed-off-by: Yuan Can <yuancan@huawei.com>
---
 drivers/firmware/raspberrypi.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
index 4b8978b254f9..a9d7aafc6309 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -268,12 +268,9 @@ static int rpi_firmware_probe(struct platform_device *pdev)
 	fw->cl.tx_block = true;
 
 	fw->chan = mbox_request_channel(&fw->cl, 0);
-	if (IS_ERR(fw->chan)) {
-		int ret = PTR_ERR(fw->chan);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "Failed to get mbox channel: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(fw->chan))
+		return dev_err_probe(dev, PTR_ERR(fw->chan),
+				     "Failed to get mbox channel\n");
 
 	init_completion(&fw->c);
 	kref_init(&fw->consumers);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] firmware: raspberrypi: Use dev_err_probe() to simplify code
  2022-09-24  2:50 [PATCH] firmware: raspberrypi: Use dev_err_probe() to simplify code Yuan Can
@ 2022-09-25 17:51 ` Florian Fainelli
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Fainelli @ 2022-09-25 17:51 UTC (permalink / raw)
  To: bcm-kernel-feedback-list, Yuan Can, linux-rpi-kernel, linux-arm-kernel

On Sat, 24 Sep 2022 02:50:41 +0000, Yuan Can <yuancan@huawei.com> wrote:
> In the probe path, dev_err() can be replaced with dev_err_probe()
> which will check if error code is -EPROBE_DEFER and prints the
> error name. It also sets the defer probe reason which can be
> checked later through debugfs.
> 
> Signed-off-by: Yuan Can <yuancan@huawei.com>
> ---

Applied to https://github.com/Broadcom/stblinux/commits/drivers/next, thanks!
--
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-09-25 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24  2:50 [PATCH] firmware: raspberrypi: Use dev_err_probe() to simplify code Yuan Can
2022-09-25 17:51 ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.