Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea1361fd authored by Axel Lin's avatar Axel Lin Committed by Linus Walleij
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarAndrew F. Davis <afd@ti.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 67ebb742
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -125,16 +125,13 @@ 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;
	}

	mutex_init(&gpio->lock);