From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH v2 2/2] Input: wdt87xx_i2c - switch to use dev_err_probe()
Date: Tue, 13 Jan 2026 09:22:58 +0100 [thread overview]
Message-ID: <20260113082445.44186-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20260113082445.44186-1-andriy.shevchenko@linux.intel.com>
Switch to use dev_err_probe() to simplify the error path and
unify a message template. With that being done, drop the now no-op
message for -ENOMEM as allocator will print a big warning anyway
and remove duplicate message for devm_request_threaded_irq().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/input/touchscreen/wdt87xx_i2c.c | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index 99636d6eb0f3..3bf899fe615c 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -1033,10 +1033,8 @@ static int wdt87xx_ts_create_input_device(struct wdt87xx_data *wdt)
int error;
input = devm_input_allocate_device(dev);
- if (!input) {
- dev_err(dev, "failed to allocate input device\n");
+ if (!input)
return -ENOMEM;
- }
wdt->input = input;
input->name = "WDT87xx Touchscreen";
@@ -1060,16 +1058,15 @@ static int wdt87xx_ts_create_input_device(struct wdt87xx_data *wdt)
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
error = input_register_device(input);
- if (error) {
- dev_err(dev, "failed to register input device: %d\n", error);
- return error;
- }
+ if (error)
+ return dev_err_probe(dev, error, "failed to register input device\n");
return 0;
}
static int wdt87xx_ts_probe(struct i2c_client *client)
{
+ struct device *dev = &client->dev;
struct wdt87xx_data *wdt;
int error;
@@ -1099,16 +1096,9 @@ static int wdt87xx_ts_probe(struct i2c_client *client)
if (error)
return error;
- error = devm_request_threaded_irq(&client->dev, client->irq,
- NULL, wdt87xx_ts_interrupt,
- IRQF_ONESHOT,
- client->name, wdt);
- if (error) {
- dev_err(&client->dev, "request irq failed: %d\n", error);
- return error;
- }
-
- return 0;
+ return devm_request_threaded_irq(dev, client->irq,
+ NULL, wdt87xx_ts_interrupt,
+ IRQF_ONESHOT, client->name, wdt);
}
static int wdt87xx_suspend(struct device *dev)
--
2.50.1
next prev parent reply other threads:[~2026-01-13 8:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 8:22 [PATCH v2 0/2] Input: wdt87xx_i2c - a couple of cleanups Andy Shevchenko
2026-01-13 8:22 ` [PATCH v2 1/2] Input: wdt87xx_i2c - tidy up ACPI ID table Andy Shevchenko
2026-01-20 20:42 ` Dmitry Torokhov
2026-01-20 21:07 ` Andy Shevchenko
2026-01-13 8:22 ` Andy Shevchenko [this message]
2026-01-20 20:40 ` [PATCH v2 2/2] Input: wdt87xx_i2c - switch to use dev_err_probe() Dmitry Torokhov
2026-01-20 21:09 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260113082445.44186-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox