Commit c567b00c authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: aw9523: Make use of dev_err_probe()

Simplify the error handling in probe function by switching from
dev_err() to dev_err_probe().
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Message-ID: <20240329105634.712457-9-andy.shevchenko@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 6bf27086
...@@ -816,10 +816,8 @@ static int aw9523_init_irq(struct aw9523 *awi, int irq) ...@@ -816,10 +816,8 @@ static int aw9523_init_irq(struct aw9523 *awi, int irq)
ret = devm_request_threaded_irq(dev, irq, NULL, aw9523_irq_thread_func, ret = devm_request_threaded_irq(dev, irq, NULL, aw9523_irq_thread_func,
IRQF_ONESHOT, dev_name(dev), awi); IRQF_ONESHOT, dev_name(dev), awi);
if (ret) { if (ret)
dev_err(dev, "Failed to request irq %d\n", irq); return dev_err_probe(dev, ret, "Failed to request irq %d\n", irq);
return ret;
}
girq = &awi->gpio.irq; girq = &awi->gpio.irq;
gpio_irq_chip_set_chip(girq, &aw9523_irq_chip); gpio_irq_chip_set_chip(girq, &aw9523_irq_chip);
...@@ -1016,8 +1014,7 @@ static int aw9523_probe(struct i2c_client *client) ...@@ -1016,8 +1014,7 @@ static int aw9523_probe(struct i2c_client *client)
awi->pctl = devm_pinctrl_register(dev, pdesc, awi); awi->pctl = devm_pinctrl_register(dev, pdesc, awi);
if (IS_ERR(awi->pctl)) { if (IS_ERR(awi->pctl)) {
ret = PTR_ERR(awi->pctl); ret = dev_err_probe(dev, PTR_ERR(awi->pctl), "Cannot register pinctrl");
dev_err(dev, "Cannot register pinctrl: %d", ret);
goto err_disable_vregs; goto err_disable_vregs;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment