Skip to content

Commit

Permalink
spi-gpio: Use PTR_ERR_OR_ZERO() in spi_gpio_request()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Elfring authored and Mark Brown committed Sep 9, 2019
1 parent d1c44c9 commit 8995673
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/spi/spi-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8995673

Please sign in to comment.