summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-gpio.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-07 14:51:16 +0300
committerMark Brown <broonie@kernel.org>2019-09-09 13:05:39 +0300
commit8995673e6f584c2140b565d9ef20e4e4599aad7e (patch)
tree71434d227c7dd176c598ae9f9dadcfba0bbb6625 /drivers/spi/spi-gpio.c
parentd1c44c9342c17e3314371325d9272684a075b65c (diff)
downloadlinux-8995673e6f584c2140b565d9ef20e4e4599aad7e.tar.xz
spi-gpio: Use PTR_ERR_OR_ZERO() in spi_gpio_request()
Simplify this function implementation by using a known function. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/b2dd074a-1693-3aea-42b4-da1f5ec155c4@web.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-gpio.c')
-rw-r--r--drivers/spi/spi-gpio.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 9eb82150666e..1d3e23ec20a6 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -290,10 +290,7 @@ static int spi_gpio_request(struct device *dev, struct spi_gpio *spi_gpio)
return PTR_ERR(spi_gpio->miso);
spi_gpio->sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW);
- if (IS_ERR(spi_gpio->sck))
- return PTR_ERR(spi_gpio->sck);
-
- return 0;
+ return PTR_ERR_OR_ZERO(spi_gpio->sck);
}
#ifdef CONFIG_OF