Skip to content

Commit 60ea3db

Browse files
Jinjie Ruanbroonie
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 1c351c2 commit 60ea3db

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/spi/spi-at91-usart.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev)
485485

486486
cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
487487

488-
if (IS_ERR(cs_gpios))
489-
return PTR_ERR(cs_gpios);
490-
491-
return 0;
488+
return PTR_ERR_OR_ZERO(cs_gpios);
492489
}
493490

494491
static int at91_usart_spi_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)