mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 05:04:00 +08:00
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>
This commit is contained in:
parent
d34607d11d
commit
21d08ab9c9
@ -125,15 +125,12 @@ static int pisosr_gpio_probe(struct spi_device *spi)
|
|||||||
if (!gpio->buffer)
|
if (!gpio->buffer)
|
||||||
return -ENOMEM;
|
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)) {
|
if (IS_ERR(gpio->load_gpio)) {
|
||||||
ret = PTR_ERR(gpio->load_gpio);
|
ret = PTR_ERR(gpio->load_gpio);
|
||||||
if (ret != -ENOENT && ret != -ENOSYS) {
|
if (ret != -EPROBE_DEFER)
|
||||||
if (ret != -EPROBE_DEFER)
|
dev_err(dev, "Unable to allocate load GPIO\n");
|
||||||
dev_err(dev, "Unable to allocate load GPIO\n");
|
return ret;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
gpio->load_gpio = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_init(&gpio->lock);
|
mutex_init(&gpio->lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user