Skip to content

Commit

Permalink
net: ethernet: ti: am65-cpts: Switch to use dev_err_probe() helper
Browse files Browse the repository at this point in the history
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Yang Yingliang authored and davem330 committed Sep 21, 2022
1 parent 63b7c2e commit e2baa12
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/ethernet/ti/am65-cpts.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,9 +943,7 @@ struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
cpts->irq = of_irq_get_byname(node, "cpts");
if (cpts->irq <= 0) {
ret = cpts->irq ?: -ENXIO;
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to get IRQ number (err = %d)\n",
ret);
dev_err_probe(dev, ret, "Failed to get IRQ number\n");
return ERR_PTR(ret);
}

Expand All @@ -965,8 +963,7 @@ struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
cpts->refclk = devm_get_clk_from_child(dev, node, "cpts");
if (IS_ERR(cpts->refclk)) {
ret = PTR_ERR(cpts->refclk);
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to get refclk %d\n", ret);
dev_err_probe(dev, ret, "Failed to get refclk\n");
return ERR_PTR(ret);
}

Expand Down

0 comments on commit e2baa12

Please sign in to comment.