i2c: davinci: Simplify with dev_err_probe()
authorKrzysztof Kozlowski <krzk@kernel.org>
Wed, 2 Sep 2020 15:06:39 +0000 (17:06 +0200)
committerWolfram Sang <wsa@kernel.org>
Wed, 23 Jun 2021 16:23:55 +0000 (18:23 +0200)
Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-davinci.c

index 232a767..e9d0732 100644 (file)
@@ -768,10 +768,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
        if (irq <= 0) {
                if (!irq)
                        irq = -ENXIO;
-               if (irq != -EPROBE_DEFER)
-                       dev_err(&pdev->dev,
-                               "can't get irq resource ret=%d\n", irq);
-               return irq;
+               return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
        }
 
        dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),