All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] firmware: imx: Use dev_err_probe() to simplify code
@ 2022-09-24  2:47 Yuan Can
  2022-09-24  2:47 ` [PATCH 1/2] firmware: imx: scu: " Yuan Can
  2022-09-24  2:48 ` [PATCH 2/2] firmware: imx-dsp: " Yuan Can
  0 siblings, 2 replies; 3+ messages in thread
From: Yuan Can @ 2022-09-24  2:47 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, linux-imx, linux-arm-kernel; +Cc: yuancan

This series simplify the error handling in probe function by
switching from dev_err() to dev_err_probe().

Yuan Can (2):
  firmware: imx: scu: Use dev_err_probe() to simplify code
  firmware: imx-dsp: Use dev_err_probe() to simplify code

 drivers/firmware/imx/imx-dsp.c | 7 +++----
 drivers/firmware/imx/imx-scu.c | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)

-- 
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	[flat|nested] 3+ messages in thread

* [PATCH 1/2] firmware: imx: scu: Use dev_err_probe() to simplify code
  2022-09-24  2:47 [PATCH 0/2] firmware: imx: Use dev_err_probe() to simplify code Yuan Can
@ 2022-09-24  2:47 ` Yuan Can
  2022-09-24  2:48 ` [PATCH 2/2] firmware: imx-dsp: " Yuan Can
  1 sibling, 0 replies; 3+ messages in thread
From: Yuan Can @ 2022-09-24  2:47 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, linux-imx, 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/imx/imx-scu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/imx/imx-scu.c b/drivers/firmware/imx/imx-scu.c
index dca79caccd01..85bcda1637db 100644
--- a/drivers/firmware/imx/imx-scu.c
+++ b/drivers/firmware/imx/imx-scu.c
@@ -309,10 +309,9 @@ static int imx_scu_probe(struct platform_device *pdev)
 		sc_chan->idx = i % (num_channel / 2);
 		sc_chan->ch = mbox_request_channel_byname(cl, chan_name);
 		if (IS_ERR(sc_chan->ch)) {
-			ret = PTR_ERR(sc_chan->ch);
-			if (ret != -EPROBE_DEFER)
-				dev_err(dev, "Failed to request mbox chan %s ret %d\n",
-					chan_name, ret);
+			ret = dev_err_probe(dev, PTR_ERR(sc_chan->ch),
+					    "Failed to request mbox chan %s\n",
+					    chan_name);
 			kfree(chan_name);
 			return ret;
 		}
-- 
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] 3+ messages in thread

* [PATCH 2/2] firmware: imx-dsp: Use dev_err_probe() to simplify code
  2022-09-24  2:47 [PATCH 0/2] firmware: imx: Use dev_err_probe() to simplify code Yuan Can
  2022-09-24  2:47 ` [PATCH 1/2] firmware: imx: scu: " Yuan Can
@ 2022-09-24  2:48 ` Yuan Can
  1 sibling, 0 replies; 3+ messages in thread
From: Yuan Can @ 2022-09-24  2:48 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, festevam, linux-imx, 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/imx/imx-dsp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c
index a6c06d7476c3..b76d01045ea8 100644
--- a/drivers/firmware/imx/imx-dsp.c
+++ b/drivers/firmware/imx/imx-dsp.c
@@ -115,10 +115,9 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
 		dsp_chan->idx = i % 2;
 		dsp_chan->ch = mbox_request_channel_byname(cl, chan_name);
 		if (IS_ERR(dsp_chan->ch)) {
-			ret = PTR_ERR(dsp_chan->ch);
-			if (ret != -EPROBE_DEFER)
-				dev_err(dev, "Failed to request mbox chan %s ret %d\n",
-					chan_name, ret);
+			ret = dev_err_probe(dev, PTR_ERR(dsp_chan->ch),
+					    "Failed to request mbox chan %s\n",
+					    chan_name);
 			goto out;
 		}
 
-- 
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] 3+ messages in thread

end of thread, other threads:[~2022-09-24  2:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24  2:47 [PATCH 0/2] firmware: imx: Use dev_err_probe() to simplify code Yuan Can
2022-09-24  2:47 ` [PATCH 1/2] firmware: imx: scu: " Yuan Can
2022-09-24  2:48 ` [PATCH 2/2] firmware: imx-dsp: " Yuan Can

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.