summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-at91-usart.c
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2023-08-22 20:46:42 +0800
committerMark Brown <broonie@kernel.org>2023-08-22 13:51:35 +0100
commit60ea3db33fbddf559e18567ca8897f6bb9f25290 (patch)
tree0bcace77f21b6b1e0832c327c0e9320be3b69807 /drivers/spi/spi-at91-usart.c
parent1c351c236ac58e7e0ac3b5e1fe50be532bc937c4 (diff)
spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://lore.kernel.org/r/20230822124643.987079-1-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-at91-usart.c')
-rw-r--r--drivers/spi/spi-at91-usart.c5
1 files changed, 1 insertions, 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)