]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: xiic: Simplify with dev_err_probe()
authorKrzysztof Kozlowski <krzk@kernel.org>
Wed, 2 Sep 2020 15:06:36 +0000 (17:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:08:25 +0000 (15:08 +0200)
[ 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 <krzk@kernel.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Stable-dep-of: 0c8d604dea43 ("i2c: xiic: Fix pm_runtime_set_suspended() with runtime pm enabled")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-xiic.c

index d10f7fd868b6ec08c6d47aa1be5e2c6cf796645f..2642062ce5b32f28df251f0e23a94d24c999a5f6 100644 (file)
@@ -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");