summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-pisosr.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2016-02-22 15:16:51 +0300
committerLinus Walleij <linus.walleij@linaro.org>2016-02-25 17:20:46 +0300
commit21d08ab9c9d8dc17ee650b28cea8b3175065e201 (patch)
tree7fe23135a0283505f655c6596f5ff135d2680ca5 /drivers/gpio/gpio-pisosr.c
parentd34607d11d7c72a201715e720048ca5eee613706 (diff)
downloadlinux-21d08ab9c9d8dc17ee650b28cea8b3175065e201.tar.xz
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>
Diffstat (limited to 'drivers/gpio/gpio-pisosr.c')
-rw-r--r--drivers/gpio/gpio-pisosr.c11
1 files changed, 4 insertions, 7 deletions
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);