Skip to content

Commit b20b54f

Browse files
caihuoqing1990davem330
authored andcommitted
net: stmmac: dwmac-visconti: Make use of the helper function dev_err_probe()
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing <[email protected]> Acked-by: Nobuhiro Iwamatsu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3503e67 commit b20b54f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ static int visconti_eth_clock_probe(struct platform_device *pdev,
171171
int err;
172172

173173
dwmac->phy_ref_clk = devm_clk_get(&pdev->dev, "phy_ref_clk");
174-
if (IS_ERR(dwmac->phy_ref_clk)) {
175-
dev_err(&pdev->dev, "phy_ref_clk clock not found.\n");
176-
return PTR_ERR(dwmac->phy_ref_clk);
177-
}
174+
if (IS_ERR(dwmac->phy_ref_clk))
175+
return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->phy_ref_clk),
176+
"phy_ref_clk clock not found.\n");
178177

179178
err = clk_prepare_enable(dwmac->phy_ref_clk);
180179
if (err < 0) {

0 commit comments

Comments
 (0)