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

Input: raydium_i2c_ts - do not ignore EPROBE_DEFER from gpiod_get_optional

We should not be ignoring -EPROBE_DEFER reported by
devm_gpiod_get_optional(), but report it as any other error to the upper
layers. While we are at it simplify check for the presence of reset GPIO
and instead of using IS_ERR_OR_NULL just use boolean.

Also do not return -ENOMEM from suspend handler when the device in
bootloader mode as that does not make sense and switch to -EBUSY instead.

Reported-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+5 -6
+5 -6
drivers/input/touchscreen/raydium_i2c_ts.c
··· 930 930 { 931 931 int error; 932 932 933 - if (IS_ERR_OR_NULL(ts->reset_gpio)) 933 + if (!ts->reset_gpio) 934 934 return 0; 935 935 936 936 gpiod_set_value_cansleep(ts->reset_gpio, 1); ··· 967 967 { 968 968 struct raydium_data *ts = _data; 969 969 970 - if (!IS_ERR_OR_NULL(ts->reset_gpio)) { 970 + if (ts->reset_gpio) { 971 971 gpiod_set_value_cansleep(ts->reset_gpio, 1); 972 972 regulator_disable(ts->vccio); 973 973 regulator_disable(ts->avdd); ··· 1018 1018 GPIOD_OUT_LOW); 1019 1019 if (IS_ERR(ts->reset_gpio)) { 1020 1020 error = PTR_ERR(ts->reset_gpio); 1021 - if (error != -EPROBE_DEFER) { 1021 + if (error != -EPROBE_DEFER) 1022 1022 dev_err(&client->dev, 1023 1023 "failed to get reset gpio: %d\n", error); 1024 - return error; 1025 - } 1024 + return error; 1026 1025 } 1027 1026 1028 1027 error = raydium_i2c_power_on(ts); ··· 1137 1138 1138 1139 /* Sleep is not available in BLDR recovery mode */ 1139 1140 if (ts->boot_mode != RAYDIUM_TS_MAIN) 1140 - return -ENOMEM; 1141 + return -EBUSY; 1141 1142 1142 1143 disable_irq(client->irq); 1143 1144