Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Biju Das and committed by
Dmitry Torokhov
bd2334ed 9594f273

+4 -15
+4 -15
drivers/input/misc/da9063_onkey.c
··· 185 185 186 186 onkey = devm_kzalloc(&pdev->dev, sizeof(struct da9063_onkey), 187 187 GFP_KERNEL); 188 - if (!onkey) { 189 - dev_err(&pdev->dev, "Failed to allocate memory.\n"); 188 + if (!onkey) 190 189 return -ENOMEM; 191 - } 192 190 193 191 onkey->config = device_get_match_data(&pdev->dev); 194 192 if (!onkey->config) ··· 204 206 "dlg,disable-key-power"); 205 207 206 208 onkey->input = devm_input_allocate_device(&pdev->dev); 207 - if (!onkey->input) { 208 - dev_err(&pdev->dev, "Failed to allocated input device.\n"); 209 + if (!onkey->input) 209 210 return -ENOMEM; 210 - } 211 211 212 212 onkey->input->name = onkey->config->name; 213 213 snprintf(onkey->phys, sizeof(onkey->phys), "%s/input0", ··· 217 221 218 222 error = devm_delayed_work_autocancel(&pdev->dev, &onkey->work, 219 223 da9063_poll_on); 220 - if (error) { 221 - dev_err(&pdev->dev, 222 - "Failed to add cancel poll action: %d\n", 223 - error); 224 + if (error) 224 225 return error; 225 - } 226 226 227 227 irq = platform_get_irq_byname(pdev, "ONKEY"); 228 228 if (irq < 0) ··· 243 251 device_init_wakeup(&pdev->dev, true); 244 252 245 253 error = input_register_device(onkey->input); 246 - if (error) { 247 - dev_err(&pdev->dev, 248 - "Failed to register input device: %d\n", error); 254 + if (error) 249 255 return error; 250 - } 251 256 252 257 return 0; 253 258 }