]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gpio: pca953x: Utilise dev_err_probe() where it makes sense
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 1 Sep 2023 13:40:34 +0000 (16:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2026 15:29:57 +0000 (16:29 +0100)
[ Upstream commit c47f7ff0fe61738a40b1b4fef3cd8317ec314079 ]

At least in pca953x_irq_setup() we may use dev_err_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Stable-dep-of: 014a17deb412 ("gpio: pca953x: handle short interrupt pulses on PCAL devices")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-pca953x.c

index faadbe66b23e71b1ee1e912c0adbbcc8bef0c2b1..3a0b999521e4493316792f73a1ec604c152605f1 100644 (file)
@@ -895,6 +895,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
 {
        struct i2c_client *client = chip->client;
+       struct device *dev = &client->dev;
        DECLARE_BITMAP(reg_direction, MAX_LINE);
        DECLARE_BITMAP(irq_stat, MAX_LINE);
        struct gpio_irq_chip *girq;
@@ -943,11 +944,8 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
                                        NULL, pca953x_irq_handler,
                                        IRQF_ONESHOT | IRQF_SHARED,
                                        dev_name(&client->dev), chip);
-       if (ret) {
-               dev_err(&client->dev, "failed to request irq %d\n",
-                       client->irq);
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(dev, client->irq, "failed to request irq\n");
 
        return 0;
 }