diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-09-02 18:06:38 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-06-23 19:22:28 +0300 |
commit | 2d1a83a4f36f1a6fd8c510db409772e34bf4eed1 (patch) | |
tree | 6ae26dd388c15f4e4ca554cb5d6041fb6bcaf231 /drivers | |
parent | 9dbba3f87c7823cf35e63fb7a2449a5d54b3b799 (diff) | |
download | linux-2d1a83a4f36f1a6fd8c510db409772e34bf4eed1.tar.xz |
i2c: cadence: 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: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-cadence.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index 5a14f0265669..565401bfbcc6 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -1251,11 +1251,10 @@ static int cdns_i2c_probe(struct platform_device *pdev) "Cadence I2C at %08lx", (unsigned long)r_mem->start); id->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(id->clk)) { - if (PTR_ERR(id->clk) != -EPROBE_DEFER) - dev_err(&pdev->dev, "input clock not found.\n"); - return PTR_ERR(id->clk); - } + if (IS_ERR(id->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(id->clk), + "input clock not found.\n"); + ret = clk_prepare_enable(id->clk); if (ret) dev_err(&pdev->dev, "Unable to enable clock.\n"); |