Commit de0665c8 authored by Yang Yingliang's avatar Yang Yingliang Committed by Jakub Kicinski

net: mdio: mux-meson-g12a: 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>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220915065043.665138-1-yangyingliang@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1089877a
...@@ -233,11 +233,9 @@ static int g12a_ephy_glue_clk_register(struct device *dev) ...@@ -233,11 +233,9 @@ static int g12a_ephy_glue_clk_register(struct device *dev)
snprintf(in_name, sizeof(in_name), "clkin%d", i); snprintf(in_name, sizeof(in_name), "clkin%d", i);
clk = devm_clk_get(dev, in_name); clk = devm_clk_get(dev, in_name);
if (IS_ERR(clk)) { if (IS_ERR(clk))
if (PTR_ERR(clk) != -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(clk),
dev_err(dev, "Missing clock %s\n", in_name); "Missing clock %s\n", in_name);
return PTR_ERR(clk);
}
parent_names[i] = __clk_get_name(clk); parent_names[i] = __clk_get_name(clk);
} }
...@@ -317,12 +315,9 @@ static int g12a_mdio_mux_probe(struct platform_device *pdev) ...@@ -317,12 +315,9 @@ static int g12a_mdio_mux_probe(struct platform_device *pdev)
return PTR_ERR(priv->regs); return PTR_ERR(priv->regs);
priv->pclk = devm_clk_get(dev, "pclk"); priv->pclk = devm_clk_get(dev, "pclk");
if (IS_ERR(priv->pclk)) { if (IS_ERR(priv->pclk))
ret = PTR_ERR(priv->pclk); return dev_err_probe(dev, PTR_ERR(priv->pclk),
if (ret != -EPROBE_DEFER) "failed to get peripheral clock\n");
dev_err(dev, "failed to get peripheral clock\n");
return ret;
}
/* Make sure the device registers are clocked */ /* Make sure the device registers are clocked */
ret = clk_prepare_enable(priv->pclk); ret = clk_prepare_enable(priv->pclk);
...@@ -339,8 +334,7 @@ static int g12a_mdio_mux_probe(struct platform_device *pdev) ...@@ -339,8 +334,7 @@ static int g12a_mdio_mux_probe(struct platform_device *pdev)
ret = mdio_mux_init(dev, dev->of_node, g12a_mdio_switch_fn, ret = mdio_mux_init(dev, dev->of_node, g12a_mdio_switch_fn,
&priv->mux_handle, dev, NULL); &priv->mux_handle, dev, NULL);
if (ret) { if (ret) {
if (ret != -EPROBE_DEFER) dev_err_probe(dev, ret, "mdio multiplexer init failed\n");
dev_err(dev, "mdio multiplexer init failed: %d", ret);
goto err; goto err;
} }
......
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