* [PATCH] hwrng: bcm2835: Handle deferred clock properly
@ 2018-02-12 20:11 Stefan Wahren
2018-02-12 20:22 ` Florian Fainelli
2018-02-22 15:11 ` Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Wahren @ 2018-02-12 20:11 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
drivers/char/hw_random/bcm2835-rng.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
index 7a84cec..6767d96 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;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] hwrng: bcm2835: Handle deferred clock properly
2018-02-12 20:11 [PATCH] hwrng: bcm2835: Handle deferred clock properly Stefan Wahren
@ 2018-02-12 20:22 ` Florian Fainelli
2018-02-22 15:11 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2018-02-12 20:22 UTC (permalink / raw)
To: linux-arm-kernel
On 02/12/2018 12:11 PM, Stefan Wahren wrote:
> 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>
Thanks Stephan!
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] hwrng: bcm2835: Handle deferred clock properly
2018-02-12 20:11 [PATCH] hwrng: bcm2835: Handle deferred clock properly Stefan Wahren
2018-02-12 20:22 ` Florian Fainelli
@ 2018-02-22 15:11 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2018-02-22 15:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Feb 12, 2018 at 09:11:36PM +0100, Stefan Wahren wrote:
> 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>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-22 15:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 20:11 [PATCH] hwrng: bcm2835: Handle deferred clock properly Stefan Wahren
2018-02-12 20:22 ` Florian Fainelli
2018-02-22 15:11 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).