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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ili210x - convert to dev_err_probe()

Simplify error return handling, use dev_err_probe() where possible.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260117001215.59272-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Marek Vasut and committed by
Dmitry Torokhov
05c7f348 f8a6e5ea

+10 -21
+10 -21
drivers/input/touchscreen/ili210x.c
··· 942 942 chip = device_get_match_data(dev); 943 943 if (!chip && id) 944 944 chip = (const struct ili2xxx_chip *)id->driver_data; 945 - if (!chip) { 946 - dev_err(&client->dev, "unknown device model\n"); 947 - return -ENODEV; 948 - } 945 + if (!chip) 946 + return dev_err_probe(&client->dev, -ENODEV, "unknown device model\n"); 949 947 950 - if (client->irq <= 0) { 951 - dev_err(dev, "No IRQ!\n"); 952 - return -EINVAL; 953 - } 948 + if (client->irq <= 0) 949 + return dev_err_probe(dev, -EINVAL, "No IRQ!\n"); 954 950 955 951 reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); 956 952 if (IS_ERR(reset_gpio)) ··· 994 998 995 999 error = input_mt_init_slots(input, priv->chip->max_touches, 996 1000 INPUT_MT_DIRECT); 997 - if (error) { 998 - dev_err(dev, "Unable to set up slots, err: %d\n", error); 999 - return error; 1000 - } 1001 + if (error) 1002 + return dev_err_probe(dev, error, "Unable to set up slots\n"); 1001 1003 1002 1004 error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, 1003 1005 IRQF_ONESHOT, client->name, priv); 1004 - if (error) { 1005 - dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", 1006 - error); 1007 - return error; 1008 - } 1006 + if (error) 1007 + return dev_err_probe(dev, error, "Unable to request touchscreen IRQ\n"); 1009 1008 1010 1009 error = devm_add_action_or_reset(dev, ili210x_stop, priv); 1011 1010 if (error) 1012 1011 return error; 1013 1012 1014 1013 error = input_register_device(priv->input); 1015 - if (error) { 1016 - dev_err(dev, "Cannot register input device, err: %d\n", error); 1017 - return error; 1018 - } 1014 + if (error) 1015 + return dev_err_probe(dev, error, "Cannot register input device\n"); 1019 1016 1020 1017 return 0; 1021 1018 }