mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04: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 <[email protected]> Acked-by: Andrew F. Davis <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
67ebb742b9
commit
ea1361fd5f
1 changed files with 4 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue