Skip to content

Commit

Permalink
fpga: xilinx-pr-decoupler: Simplify code by using dev_err_probe()
Browse files Browse the repository at this point in the history
Use already prepared dev_err_probe() introduced by commit a787e54
("driver core: add device probe log helper").
It simplifies EPROBE_DEFER handling.

Signed-off-by: Michal Simek <[email protected]>
Signed-off-by: Moritz Fischer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Michal Simek authored and gregkh committed Mar 24, 2021
1 parent ce453ee commit b5c6ecf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/fpga/xilinx-pr-decoupler.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ static int xlnx_pr_decoupler_probe(struct platform_device *pdev)
return PTR_ERR(priv->io_base);

priv->clk = devm_clk_get(&pdev->dev, "aclk");
if (IS_ERR(priv->clk)) {
if (PTR_ERR(priv->clk) != -EPROBE_DEFER)
dev_err(&pdev->dev, "input clock not found\n");
return PTR_ERR(priv->clk);
}
if (IS_ERR(priv->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk),
"input clock not found\n");

err = clk_prepare_enable(priv->clk);
if (err) {
Expand Down

0 comments on commit b5c6ecf

Please sign in to comment.