summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-pca953x.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-09-01 16:40:34 +0300
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-09-11 10:00:00 +0300
commitc47f7ff0fe61738a40b1b4fef3cd8317ec314079 (patch)
tree8781c4fd52dd9b83ee9c38dcdf55f99e41c5be50 /drivers/gpio/gpio-pca953x.c
parent53c59d66c44c5eb98b34da9967f937e5387f8624 (diff)
downloadlinux-c47f7ff0fe61738a40b1b4fef3cd8317ec314079.tar.xz
gpio: pca953x: Utilise dev_err_probe() where it makes sense
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>
Diffstat (limited to 'drivers/gpio/gpio-pca953x.c')
-rw-r--r--drivers/gpio/gpio-pca953x.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 0dedb2265744..4249ec350ace 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -926,6 +926,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;
@@ -974,11 +975,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;
}