can: flexcan: Switch to use dev_err_probe() helper
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 14 Sep 2022 13:40:30 +0000 (21:40 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 14 Sep 2022 13:37:32 +0000 (15:37 +0200)
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/all/20220914134030.3782754-1-yangyingliang@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan/flexcan-core.c

index bbe5b0c997f84c5da2fa92ecf8c230758a54426f..5e27944b8a21c6bdd7a69134dadfe41987806dae 100644 (file)
@@ -2177,8 +2177,7 @@ static int flexcan_probe(struct platform_device *pdev)
 
        err = flexcan_setup_stop_mode(pdev);
        if (err < 0) {
-               if (err != -EPROBE_DEFER)
-                       dev_err(&pdev->dev, "setup stop mode failed\n");
+               dev_err_probe(&pdev->dev, err, "setup stop mode failed\n");
                goto failed_setup_stop_mode;
        }