]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i2c: scx200_acb: Replace dev_err() with dev_err_probe() in probe function
authorEnrico Zanda <e.zanda1@gmail.com>
Tue, 15 Apr 2025 18:34:47 +0000 (20:34 +0200)
committerAndi Shyti <andi@smida.it>
Mon, 19 May 2025 20:23:55 +0000 (22:23 +0200)
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>
drivers/i2c/busses/scx200_acb.c

index 4d6abd7e92ce82fc9b28c9ec83ed1b5800bc8bbf..06cf221557f2ea483075cef53e477569c05010b6 100644 (file)
@@ -500,10 +500,8 @@ static int scx200_probe(struct platform_device *pdev)
        struct resource *res;
 
        res = platform_get_resource(pdev, IORESOURCE_IO, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "can't fetch device resource info\n");
-               return -ENODEV;
-       }
+       if (!res)
+               return dev_err_probe(&pdev->dev, -ENODEV, "can't fetch device resource info\n");
 
        iface = scx200_create_dev("CS5535", res->start, 0, &pdev->dev);
        if (!iface)