Commit e2baa126 authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

net: ethernet: ti: am65-cpts: Switch to use dev_err_probe() helper

dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63b7c2eb
......@@ -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);
}
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment