diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2018-02-12 21:11:36 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-30 08:17:42 +0200 |
commit | 642faadfcd5ff474819de30af0cfd04740edb369 (patch) | |
tree | 95594c0c3b70bc8c1f88235361d0620234bf9438 /drivers/char | |
parent | ff3745d0b7839b64f41f0d03ebbbecbdeed0c010 (diff) |
hwrng: bcm2835 - Handle deferred clock properly
[ Upstream commit 7b4c5d30d0bd2b22c09d4d993a76e0973a873891 ]
In case the probe of the clock is deferred, we would assume it is
optional. This is wrong, so defer the probe of this driver until
the clock is available.
Fixes: 791af4f4907a ("hwrng: bcm2835 - Manage an optional clock")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/bcm2835-rng.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c index 7a84cec30c3a..6767d965c36c 100644 --- a/drivers/char/hw_random/bcm2835-rng.c +++ b/drivers/char/hw_random/bcm2835-rng.c @@ -163,6 +163,8 @@ static int bcm2835_rng_probe(struct platform_device *pdev) /* Clock is optional on most platforms */ priv->clk = devm_clk_get(dev, NULL); + if (IS_ERR(priv->clk) && PTR_ERR(priv->clk) == -EPROBE_DEFER) + return -EPROBE_DEFER; priv->rng.name = pdev->name; priv->rng.init = bcm2835_rng_init; |