Skip to content

Commit

Permalink
gpio: gpio-xilinx: Simplify with dev_err_probe()
Browse files Browse the repository at this point in the history
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.

Signed-off-by: Srinivas Neeli <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
State: upstream (45c5277)
  • Loading branch information
Srinivas Neeli authored and Michal Simek committed Mar 22, 2021
1 parent d280ad1 commit 6d32404
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/gpio/gpio-xilinx.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,8 @@ static int xgpio_probe(struct platform_device *pdev)
}

chip->clk = devm_clk_get_optional(&pdev->dev, NULL);
if (IS_ERR(chip->clk)) {
if (PTR_ERR(chip->clk) != -EPROBE_DEFER)
dev_dbg(&pdev->dev, "Input clock not found\n");
return PTR_ERR(chip->clk);
}
if (IS_ERR(chip->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(chip->clk), "input clock not found.\n");

status = clk_prepare_enable(chip->clk);
if (status < 0) {
Expand Down

0 comments on commit 6d32404

Please sign in to comment.