Commit 91a73027 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Wolfram Sang

i2c: rk3x: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent b5b5b320
...@@ -1312,18 +1312,13 @@ static int rk3x_i2c_probe(struct platform_device *pdev) ...@@ -1312,18 +1312,13 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
i2c->pclk = devm_clk_get(&pdev->dev, "pclk"); i2c->pclk = devm_clk_get(&pdev->dev, "pclk");
} }
if (IS_ERR(i2c->clk)) { if (IS_ERR(i2c->clk))
ret = PTR_ERR(i2c->clk); return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
if (ret != -EPROBE_DEFER) "Can't get bus clk\n");
dev_err(&pdev->dev, "Can't get bus clk: %d\n", ret);
return ret; if (IS_ERR(i2c->pclk))
} return dev_err_probe(&pdev->dev, PTR_ERR(i2c->pclk),
if (IS_ERR(i2c->pclk)) { "Can't get periph clk\n");
ret = PTR_ERR(i2c->pclk);
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "Can't get periph clk: %d\n", ret);
return ret;
}
ret = clk_prepare(i2c->clk); ret = clk_prepare(i2c->clk);
if (ret < 0) { if (ret < 0) {
......
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