Skip to content

Commit

Permalink
can: mscan: mpc5xxx_can: Make use of the helper function dev_err_probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cai Huoqing authored and Marc Kleine-Budde committed Oct 24, 2021
1 parent 39aab46 commit 28616ed
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/can/mscan/mpc5xxx_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 28616ed

Please sign in to comment.