* [PATCH] can: mscan: mpc5xxx_can: Make use of the helper function dev_err_probe()
@ 2021-09-15 14:57 Cai Huoqing
2021-10-19 9:31 ` Marc Kleine-Budde
0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-15 14:57 UTC (permalink / raw)
To: caihuoqing
Cc: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
Jakub Kicinski, linux-can, netdev, linux-kernel
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, and simplify the code.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
drivers/net/can/mscan/mpc5xxx_can.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 35892c1efef0..de4ddf79ba9b 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -293,10 +293,8 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
return -EINVAL;
base = of_iomap(np, 0);
- if (!base) {
- dev_err(&ofdev->dev, "couldn't ioremap\n");
- return err;
- }
+ if (!base)
+ return dev_err_probe(&ofdev->dev, err, "couldn't ioremap\n");
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] can: mscan: mpc5xxx_can: Make use of the helper function dev_err_probe()
2021-09-15 14:57 [PATCH] can: mscan: mpc5xxx_can: Make use of the helper function dev_err_probe() Cai Huoqing
@ 2021-10-19 9:31 ` Marc Kleine-Budde
0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2021-10-19 9:31 UTC (permalink / raw)
To: Cai Huoqing
Cc: Wolfgang Grandegger, David S. Miller, Jakub Kicinski, linux-can,
netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 677 bytes --]
On 15.09.2021 22:57:25, Cai Huoqing wrote:
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> And using dev_err_probe() can reduce code size, and simplify the code.
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.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-10-19 9:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 14:57 [PATCH] can: mscan: mpc5xxx_can: Make use of the helper function dev_err_probe() Cai Huoqing
2021-10-19 9:31 ` Marc Kleine-Budde
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.