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: gpio_decoder - unify messages with help of dev_err_probe()

Unify error messages that might appear during probe phase by
switching to use dev_err_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251113154616.3107676-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Andy Shevchenko and committed by
Dmitry Torokhov
7cda46c3 c83504aa

+10 -16
+10 -16
drivers/input/misc/gpio_decoder.c
··· 7 7 */ 8 8 9 9 #include <linux/device.h> 10 + #include <linux/err.h> 10 11 #include <linux/gpio/consumer.h> 11 12 #include <linux/input.h> 12 13 #include <linux/kernel.h> ··· 74 73 device_property_read_u32(dev, "linux,axis", &decoder->axis); 75 74 76 75 decoder->input_gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); 77 - if (IS_ERR(decoder->input_gpios)) { 78 - dev_err(dev, "unable to acquire input gpios\n"); 79 - return PTR_ERR(decoder->input_gpios); 80 - } 76 + if (IS_ERR(decoder->input_gpios)) 77 + return dev_err_probe(dev, PTR_ERR(decoder->input_gpios), 78 + "unable to acquire input gpios\n"); 81 79 82 - if (decoder->input_gpios->ndescs < 2) { 83 - dev_err(dev, "not enough gpios found\n"); 84 - return -EINVAL; 85 - } 80 + if (decoder->input_gpios->ndescs < 2) 81 + return dev_err_probe(dev, -EINVAL, "not enough gpios found\n"); 86 82 87 83 if (device_property_read_u32(dev, "decoder-max-value", &max)) 88 84 max = (1U << decoder->input_gpios->ndescs) - 1; ··· 95 97 input_set_abs_params(input, decoder->axis, 0, max, 0, 0); 96 98 97 99 err = input_setup_polling(input, gpio_decoder_poll_gpios); 98 - if (err) { 99 - dev_err(dev, "failed to set up polling\n"); 100 - return err; 101 - } 100 + if (err) 101 + return dev_err_probe(dev, err, "failed to set up polling\n"); 102 102 103 103 err = input_register_device(input); 104 - if (err) { 105 - dev_err(dev, "failed to register input device\n"); 106 - return err; 107 - } 104 + if (err) 105 + return dev_err_probe(dev, err, "failed to register input device\n"); 108 106 109 107 return 0; 110 108 }