[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260115161858.20226-2-marek.vasut+renesas@mailbox.org>
Date: Thu, 15 Jan 2026 17:18:08 +0100
From: Marek Vasut <marek.vasut+renesas@...lbox.org>
To: linux-input@...r.kernel.org
Cc: Marek Vasut <marek.vasut+renesas@...lbox.org>,
Conor Dooley <conor+dt@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Frank Li <Frank.Li@....com>,
Job Noorman <job@...rman.info>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Rob Herring <robh@...nel.org>,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org
Subject: [PATCH v3 2/3] 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@...lbox.org>
---
Cc: Conor Dooley <conor+dt@...nel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Frank Li <Frank.Li@....com>
Cc: Job Noorman <job@...rman.info>
Cc: Krzysztof Kozlowski <krzk+dt@...nel.org>
Cc: Rob Herring <robh@...nel.org>
Cc: devicetree@...r.kernel.org
Cc: linux-input@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Cc: linux-renesas-soc@...r.kernel.org
---
V3: New patch
---
drivers/input/touchscreen/ili210x.c | 31 ++++++++++-------------------
1 file changed, 10 insertions(+), 21 deletions(-)
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index fa38d70aded7b..a3c5321d34d7b 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)
+ 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;
}
--
2.51.0
Powered by blists - more mailing lists