diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2026-01-20 12:33:52 -0800 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-01-20 12:37:52 -0800 |
| commit | 3033da61dc3982234da896be03e50633b62cfbd3 (patch) | |
| tree | 7a8ecb89667bee613b5347a673e47ab38afd17eb | |
| parent | b58a2c1a91e79fa7eeb636433d0e8d3e6d7896c7 (diff) | |
Input: wdt87xx_i2c - switch to use dev_err_probe()
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>
Link: https://patch.msgid.link/20260113082445.44186-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
| -rw-r--r-- | drivers/input/touchscreen/wdt87xx_i2c.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c index 88d376090e6e..1e2a6bbb88cb 100644 --- a/drivers/input/touchscreen/wdt87xx_i2c.c +++ b/drivers/input/touchscreen/wdt87xx_i2c.c @@ -1026,10 +1026,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"; @@ -1053,10 +1051,8 @@ 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; } @@ -1096,10 +1092,8 @@ static int wdt87xx_ts_probe(struct i2c_client *client) NULL, wdt87xx_ts_interrupt, IRQF_ONESHOT, client->name, wdt); - if (error) { - dev_err(&client->dev, "request irq failed: %d\n", error); + if (error) return error; - } return 0; } |
