linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: xilinx_can: Simplify code by using dev_err_probe()
@ 2021-02-04 12:42 Michal Simek
  2021-02-04 12:49 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2021-02-04 12:42 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Appana Durga Kedareswara rao, David S. Miller, Jakub Kicinski,
	Marc Kleine-Budde, Naga Sureshkumar Relli, Wolfgang Grandegger,
	linux-arm-kernel, linux-can, netdev

Use already prepared dev_err_probe() introduced by commit a787e5400a1c
("driver core: add device probe log helper").
It simplifies EPROBE_DEFER handling.

Also unify message format for similar error cases.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/net/can/xilinx_can.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 37fa19c62d73..3b883e607d8b 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -1772,17 +1772,15 @@ static int xcan_probe(struct platform_device *pdev)
 	/* Getting the CAN can_clk info */
 	priv->can_clk = devm_clk_get(&pdev->dev, "can_clk");
 	if (IS_ERR(priv->can_clk)) {
-		if (PTR_ERR(priv->can_clk) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "Device clock not found.\n");
-		ret = PTR_ERR(priv->can_clk);
+		ret = dev_err_probe(&pdev->dev, PTR_ERR(priv->can_clk),
+				    "device clock not found\n");
 		goto err_free;
 	}
 
 	priv->bus_clk = devm_clk_get(&pdev->dev, devtype->bus_clk_name);
 	if (IS_ERR(priv->bus_clk)) {
-		if (PTR_ERR(priv->bus_clk) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "bus clock not found\n");
-		ret = PTR_ERR(priv->bus_clk);
+		ret = dev_err_probe(&pdev->dev, PTR_ERR(priv->bus_clk),
+				    "bus clock not found\n");
 		goto err_free;
 	}
 
-- 
2.30.0


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

* Re: [PATCH] can: xilinx_can: Simplify code by using dev_err_probe()
  2021-02-04 12:42 [PATCH] can: xilinx_can: Simplify code by using dev_err_probe() Michal Simek
@ 2021-02-04 12:49 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2021-02-04 12:49 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, git, Appana Durga Kedareswara rao,
	David S. Miller, Jakub Kicinski, Naga Sureshkumar Relli,
	Wolfgang Grandegger, linux-arm-kernel, linux-can, netdev

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

On 04.02.2021 13:42:48, Michal Simek wrote:
> Use already prepared dev_err_probe() introduced by commit a787e5400a1c
> ("driver core: add device probe log helper").
> It simplifies EPROBE_DEFER handling.
> 
> Also unify message format for similar error cases.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Applied to linux-can-next/testing.

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-02-04 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 12:42 [PATCH] can: xilinx_can: Simplify code by using dev_err_probe() Michal Simek
2021-02-04 12:49 ` Marc Kleine-Budde

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).