提交 21d08ab9 编写于 作者: A Axel Lin 提交者: Linus Walleij

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: NAxel Lin <axel.lin@ingics.com>
Acked-by: NAndrew F. Davis <afd@ti.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 d34607d1
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册