summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2026-01-17 01:12:03 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-01-20 10:24:17 -0800
commit05c7f348f64281e62da38da20a8821da2df9b9d6 (patch)
tree93069298f96190fc1b6582f5acf55d17a4c98ed9 /drivers
parentf8a6e5eac701369afb5d69aba875dc5fec93003d (diff)
Input: ili210x - convert to dev_err_probe()
Simplify error return handling, use dev_err_probe() where possible. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260117001215.59272-2-marek.vasut+renesas@mailbox.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/ili210x.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index fa38d70aded7..264eee3e61d0 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -942,15 +942,11 @@ static int ili210x_i2c_probe(struct i2c_client *client)
chip = device_get_match_data(dev);
if (!chip && id)
chip = (const struct ili2xxx_chip *)id->driver_data;
- if (!chip) {
- dev_err(&client->dev, "unknown device model\n");
- return -ENODEV;
- }
+ if (!chip)
+ return dev_err_probe(&client->dev, -ENODEV, "unknown device model\n");
- if (client->irq <= 0) {
- dev_err(dev, "No IRQ!\n");
- return -EINVAL;
- }
+ if (client->irq <= 0)
+ return dev_err_probe(dev, -EINVAL, "No IRQ!\n");
reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(reset_gpio))
@@ -998,28 +994,21 @@ static int ili210x_i2c_probe(struct i2c_client *client)
error = input_mt_init_slots(input, priv->chip->max_touches,
INPUT_MT_DIRECT);
- if (error) {
- dev_err(dev, "Unable to set up slots, err: %d\n", error);
- return error;
- }
+ if (error)
+ return dev_err_probe(dev, error, "Unable to set up slots\n");
error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq,
IRQF_ONESHOT, client->name, priv);
- if (error) {
- dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n",
- error);
- return error;
- }
+ if (error)
+ return dev_err_probe(dev, error, "Unable to request touchscreen IRQ\n");
error = devm_add_action_or_reset(dev, ili210x_stop, priv);
if (error)
return error;
error = input_register_device(priv->input);
- if (error) {
- dev_err(dev, "Cannot register input device, err: %d\n", error);
- return error;
- }
+ if (error)
+ return dev_err_probe(dev, error, "Cannot register input device\n");
return 0;
}