Commit 60a9f851 authored by Anson Huang's avatar Anson Huang Committed by Wolfram Sang

i2c: imx: Use dev_err_probe() to simplify error handling

dev_err_probe() can reduce code size, uniform error handling and record the
defer probe reason etc., use it to simplify the code.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Acked-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 62df579a
...@@ -1159,11 +1159,9 @@ static int i2c_imx_probe(struct platform_device *pdev) ...@@ -1159,11 +1159,9 @@ static int i2c_imx_probe(struct platform_device *pdev)
/* Get I2C clock */ /* Get I2C clock */
i2c_imx->clk = devm_clk_get(&pdev->dev, NULL); i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(i2c_imx->clk)) { if (IS_ERR(i2c_imx->clk))
if (PTR_ERR(i2c_imx->clk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2c_imx->clk),
dev_err(&pdev->dev, "can't get I2C clock\n"); "can't get I2C clock\n");
return PTR_ERR(i2c_imx->clk);
}
ret = clk_prepare_enable(i2c_imx->clk); ret = clk_prepare_enable(i2c_imx->clk);
if (ret) { if (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