Skip to content

Commit bd2334e

Browse files
bijudasdtor
authored andcommitted
Input: da9063 - drop redundant prints in probe()
The memory allocation core code already prints error message in case of OOM. So, drop additional print messages for OOM cases. While at it, input_register_device() is already printing error messages on failure. Drop the redundant print. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20231213214803.9931-3-biju.das.jz@bp.renesas.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 9594f27 commit bd2334e

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

drivers/input/misc/da9063_onkey.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,8 @@ static int da9063_onkey_probe(struct platform_device *pdev)
185185

186186
onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey),
187187
GFP_KERNEL);
188-
if (!onkey) {
189-
dev_err(&pdev->dev, "Failed to allocate memory.\n");
188+
if (!onkey)
190189
return -ENOMEM;
191-
}
192190

193191
onkey->config = device_get_match_data(&pdev->dev);
194192
if (!onkey->config)
@@ -206,10 +204,8 @@ static int da9063_onkey_probe(struct platform_device *pdev)
206204
"dlg,disable-key-power");
207205

208206
onkey->input = devm_input_allocate_device(&pdev->dev);
209-
if (!onkey->input) {
210-
dev_err(&pdev->dev, "Failed to allocated input device.\n");
207+
if (!onkey->input)
211208
return -ENOMEM;
212-
}
213209

214210
onkey->input->name = onkey->config->name;
215211
snprintf(onkey->phys, sizeof(onkey->phys), "%s/input0",
@@ -221,12 +217,8 @@ static int da9063_onkey_probe(struct platform_device *pdev)
221217

222218
error = devm_delayed_work_autocancel(&pdev->dev, &onkey->work,
223219
da9063_poll_on);
224-
if (error) {
225-
dev_err(&pdev->dev,
226-
"Failed to add cancel poll action: %d\n",
227-
error);
220+
if (error)
228221
return error;
229-
}
230222

231223
irq = platform_get_irq_byname(pdev, "ONKEY");
232224
if (irq < 0)
@@ -251,11 +243,8 @@ static int da9063_onkey_probe(struct platform_device *pdev)
251243
device_init_wakeup(&pdev->dev, true);
252244

253245
error = input_register_device(onkey->input);
254-
if (error) {
255-
dev_err(&pdev->dev,
256-
"Failed to register input device: %d\n", error);
246+
if (error)
257247
return error;
258-
}
259248

260249
return 0;
261250
}

0 commit comments

Comments
 (0)