Commit 9dbba3f8 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Wolfram Sang
Browse files

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent dd66b39f
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -798,11 +798,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
	init_waitqueue_head(&i2c->wait);

	i2c->clk = devm_clk_get(&pdev->dev, NULL);
	if (IS_ERR(i2c->clk)) {
		if (PTR_ERR(i2c->clk) != -EPROBE_DEFER)
			dev_err(&pdev->dev, "input clock not found.\n");
		return PTR_ERR(i2c->clk);
	}
	if (IS_ERR(i2c->clk))
		return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
				     "input clock not found.\n");

	ret = clk_prepare_enable(i2c->clk);
	if (ret) {
		dev_err(&pdev->dev, "Unable to enable clock.\n");