linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
@ 2023-08-22 12:46 Jinjie Ruan
  2023-08-22 13:11 ` Nicolas Ferre
  2023-08-22 16:33 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Jinjie Ruan @ 2023-08-22 12:46 UTC (permalink / raw)
  To: linux-spi, linux-arm-kernel, Radu Pirea, Mark Brown,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea
  Cc: ruanjinjie

Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-at91-usart.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 75d9bc606442..b11d0f993cc7 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev)
 
 	cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
 
-	if (IS_ERR(cs_gpios))
-		return PTR_ERR(cs_gpios);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(cs_gpios);
 }
 
 static int at91_usart_spi_probe(struct platform_device *pdev)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-22 16:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 12:46 [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Jinjie Ruan
2023-08-22 13:11 ` Nicolas Ferre
2023-08-22 14:15   ` Mark Brown
2023-08-22 14:45     ` Alexandre Belloni
2023-08-22 15:04       ` Mark Brown
2023-08-22 16:33 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).