Skip to content

Commit 3033da6

Browse files
andy-shevdtor
authored andcommitted
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>
1 parent b58a2c1 commit 3033da6

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

drivers/input/touchscreen/wdt87xx_i2c.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,10 +1026,8 @@ static int wdt87xx_ts_create_input_device(struct wdt87xx_data *wdt)
10261026
int error;
10271027

10281028
input = devm_input_allocate_device(dev);
1029-
if (!input) {
1030-
dev_err(dev, "failed to allocate input device\n");
1029+
if (!input)
10311030
return -ENOMEM;
1032-
}
10331031
wdt->input = input;
10341032

10351033
input->name = "WDT87xx Touchscreen";
@@ -1053,10 +1051,8 @@ static int wdt87xx_ts_create_input_device(struct wdt87xx_data *wdt)
10531051
INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED);
10541052

10551053
error = input_register_device(input);
1056-
if (error) {
1057-
dev_err(dev, "failed to register input device: %d\n", error);
1058-
return error;
1059-
}
1054+
if (error)
1055+
return dev_err_probe(dev, error, "failed to register input device\n");
10601056

10611057
return 0;
10621058
}
@@ -1096,10 +1092,8 @@ static int wdt87xx_ts_probe(struct i2c_client *client)
10961092
NULL, wdt87xx_ts_interrupt,
10971093
IRQF_ONESHOT,
10981094
client->name, wdt);
1099-
if (error) {
1100-
dev_err(&client->dev, "request irq failed: %d\n", error);
1095+
if (error)
11011096
return error;
1102-
}
11031097

11041098
return 0;
11051099
}

0 commit comments

Comments
 (0)