Skip to content

Commit

Permalink
spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jinjie Ruan authored and Mark Brown committed Aug 22, 2023
1 parent 1c351c2 commit 60ea3db
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/spi/spi-at91-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 60ea3db

Please sign in to comment.