mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:24:31 +01:00
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>
This commit is contained in:
parent
b58a2c1a91
commit
3033da61dc
1 changed files with 4 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue