We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e80fc4b commit f5ad594Copy full SHA for f5ad594
drivers/leds/leds-gpio.c
@@ -125,16 +125,13 @@ static int create_gpio_led(const struct gpio_led *template,
125
return ret;
126
127
pinctrl = devm_pinctrl_get_select_default(led_dat->cdev.dev);
128
- if (IS_ERR(pinctrl)) {
129
- ret = PTR_ERR(pinctrl);
130
- if (ret != -ENODEV) {
131
- dev_warn(led_dat->cdev.dev,
132
- "Failed to select %pfw pinctrl: %d\n",
133
- fwnode, ret);
134
- } else {
135
- /* pinctrl-%d not present, not an error */
136
- ret = 0;
137
- }
+ ret = PTR_ERR_OR_ZERO(pinctrl);
+ /* pinctrl-%d not present, not an error */
+ if (ret == -ENODEV)
+ ret = 0;
+ if (ret) {
+ dev_warn(led_dat->cdev.dev, "Failed to select %pfw pinctrl: %d\n",
+ fwnode, ret);
138
}
139
140
0 commit comments