From: Krzysztof Kozlowski Date: Wed, 2 Sep 2020 15:06:36 +0000 (+0200) Subject: i2c: xiic: Simplify with dev_err_probe() X-Git-Tag: v5.10.227~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9bd3443e34e6e9bc47db21c5ba099fab097ccc8b;p=thirdparty%2Fkernel%2Fstable.git i2c: xiic: Simplify with dev_err_probe() [ Upstream commit 9dbba3f87c7823cf35e63fb7a2449a5d54b3b799 ] Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Acked-by: Michal Simek Signed-off-by: Wolfram Sang Stable-dep-of: 0c8d604dea43 ("i2c: xiic: Fix pm_runtime_set_suspended() with runtime pm enabled") Signed-off-by: Sasha Levin --- diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index d10f7fd868b6e..2642062ce5b32 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -838,11 +838,10 @@ static int xiic_i2c_probe(struct platform_device *pdev) mutex_init(&i2c->lock); 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");