提交 9dbba3f8 编写于 作者: K Krzysztof Kozlowski 提交者: Wolfram Sang

i2c: xiic: 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: NKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: NMichal Simek <michal.simek@xilinx.com>
Signed-off-by: NWolfram Sang <wsa@kernel.org>
上级 dd66b39f
...@@ -798,11 +798,10 @@ static int xiic_i2c_probe(struct platform_device *pdev) ...@@ -798,11 +798,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
init_waitqueue_head(&i2c->wait); init_waitqueue_head(&i2c->wait);
i2c->clk = devm_clk_get(&pdev->dev, NULL); i2c->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(i2c->clk)) { if (IS_ERR(i2c->clk))
if (PTR_ERR(i2c->clk) != -EPROBE_DEFER) return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
dev_err(&pdev->dev, "input clock not found.\n"); "input clock not found.\n");
return PTR_ERR(i2c->clk);
}
ret = clk_prepare_enable(i2c->clk); ret = clk_prepare_enable(i2c->clk);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Unable to enable clock.\n"); dev_err(&pdev->dev, "Unable to enable clock.\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册