Skip to content

Commit 6df6531

Browse files
zandaeAndi Shyti
authored andcommitted
i2c: scx200_acb: Replace dev_err() with dev_err_probe() in probe function
This simplifies the code while improving log. Signed-off-by: Enrico Zanda <e.zanda1@gmail.com> Link: https://lore.kernel.org/r/20250415183447.396277-11-e.zanda1@gmail.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent e7d8a0d commit 6df6531

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/i2c/busses/scx200_acb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,8 @@ static int scx200_probe(struct platform_device *pdev)
500500
struct resource *res;
501501

502502
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
503-
if (!res) {
504-
dev_err(&pdev->dev, "can't fetch device resource info\n");
505-
return -ENODEV;
506-
}
503+
if (!res)
504+
return dev_err_probe(&pdev->dev, -ENODEV, "can't fetch device resource info\n");
507505

508506
iface = scx200_create_dev("CS5535", res->start, 0, &pdev->dev);
509507
if (!iface)

0 commit comments

Comments
 (0)