]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
can: mscan: mpc5xxx_can: Make use of the helper function dev_err_probe()
authorCai Huoqing <caihuoqing@baidu.com>
Wed, 15 Sep 2021 14:57:25 +0000 (22:57 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 24 Oct 2021 14:26:05 +0000 (16:26 +0200)
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.

Link: https://lore.kernel.org/all/20210915145726.7092-1-caihuoqing@baidu.com
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/mscan/mpc5xxx_can.c

index 35892c1efef02f2f1fbeb378e0e4ff73cdb92120..de4ddf79ba9be7e61e4508dfd6e309de57040a0a 100644 (file)
@@ -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) {