From: Axel Lin Date: Mon, 22 Feb 2016 12:16:51 +0000 (+0800) Subject: gpio: pisosr: Use devm_gpiod_get_optional for gpio->load_gpio X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ea1361fd5f26f1dbb369f85b3ad42a84c133e7e1;p=linux-beck.git 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 Acked-by: Andrew F. Davis Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c index f9f1074744ab..8b8bf8f9de6a 100644 --- a/drivers/gpio/gpio-pisosr.c +++ b/drivers/gpio/gpio-pisosr.c @@ -125,15 +125,12 @@ static int pisosr_gpio_probe(struct spi_device *spi) if (!gpio->buffer) return -ENOMEM; - gpio->load_gpio = devm_gpiod_get(dev, "load", GPIOD_OUT_LOW); + gpio->load_gpio = devm_gpiod_get_optional(dev, "load", GPIOD_OUT_LOW); if (IS_ERR(gpio->load_gpio)) { ret = PTR_ERR(gpio->load_gpio); - if (ret != -ENOENT && ret != -ENOSYS) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "Unable to allocate load GPIO\n"); - return ret; - } - gpio->load_gpio = NULL; + if (ret != -EPROBE_DEFER) + dev_err(dev, "Unable to allocate load GPIO\n"); + return ret; } mutex_init(&gpio->lock);