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

gpio: pisosr: Use devm_gpiod_get_optional for gpio->load_gpio

gpio->load_gpio is optional, so use devm_gpiod_get_optional instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Axel Lin and committed by
Linus Walleij
21d08ab9 d34607d1

+4 -7
+4 -7
drivers/gpio/gpio-pisosr.c
··· 125 125 if (!gpio->buffer) 126 126 return -ENOMEM; 127 127 128 - gpio->load_gpio = devm_gpiod_get(dev, "load", GPIOD_OUT_LOW); 128 + gpio->load_gpio = devm_gpiod_get_optional(dev, "load", GPIOD_OUT_LOW); 129 129 if (IS_ERR(gpio->load_gpio)) { 130 130 ret = PTR_ERR(gpio->load_gpio); 131 - if (ret != -ENOENT && ret != -ENOSYS) { 132 - if (ret != -EPROBE_DEFER) 133 - dev_err(dev, "Unable to allocate load GPIO\n"); 134 - return ret; 135 - } 136 - gpio->load_gpio = NULL; 131 + if (ret != -EPROBE_DEFER) 132 + dev_err(dev, "Unable to allocate load GPIO\n"); 133 + return ret; 137 134 } 138 135 139 136 mutex_init(&gpio->lock);