diff options
author | Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com> | 2020-01-09 14:37:59 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2020-01-15 23:13:34 +0300 |
commit | c9d059681b846f5d0a280950ea4dc58495b9b7a9 (patch) | |
tree | 9791791a62f10c4f93b3f6545ddec66fa3b845fd /drivers/i2c/busses/i2c-xiic.c | |
parent | b4c119dbc300c7a6ee2da70d5c7ba14747b35142 (diff) | |
download | linux-c9d059681b846f5d0a280950ea4dc58495b9b7a9.tar.xz |
i2c: xiic: defer the probe if clock is not found
It's not always the case that clock is already available when i2c
driver get probed at the first time, e.g. the clock is provided by
clock wizard which may be probed after i2c driver. So let's defer
the probe when devm_clk_get() call fails and give it chance to
try later.
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-xiic.c')
-rw-r--r-- | drivers/i2c/busses/i2c-xiic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 3a403202bd28..d719bf5f9d76 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -788,7 +788,8 @@ static int xiic_i2c_probe(struct platform_device *pdev) i2c->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(i2c->clk)) { - dev_err(&pdev->dev, "input clock not found.\n"); + if (PTR_ERR(i2c->clk) != -EPROBE_DEFER) + dev_err(&pdev->dev, "input clock not found.\n"); return PTR_ERR(i2c->clk); } ret = clk_prepare_enable(i2c->clk); |