Skip to content

Commit

Permalink
spi: mpc52xx: Use gpio_is_valid()
Browse files Browse the repository at this point in the history
Replace the manual validity checks for the GPIO with the
gpio_is_valid().

Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
ArvindYadavCs authored and broonie committed Apr 27, 2018
1 parent bdf3a3b commit 0a090d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static int mpc52xx_spi_probe(struct platform_device *op)

for (i = 0; i < ms->gpio_cs_count; i++) {
gpio_cs = of_get_gpio(op->dev.of_node, i);
if (gpio_cs < 0) {
if (!gpio_is_valid(gpio_cs)) {
dev_err(&op->dev,
"could not parse the gpio field in oftree\n");
rc = -ENODEV;
Expand Down

0 comments on commit 0a090d6

Please sign in to comment.