Skip to contentSkip to conversation

hwrng: bcm2835: Handle deferred clock properly

PATCH New Stefan Wahren 3 participants 3 messages Feb 12, 2018 – Feb 22, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwrng: bcm2835: Handle deferred clock properly

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")
---
 drivers/char/hw_random/bcm2835-rng.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/char/hw_random/bcm2835-rng.c +2 -0
index 7a84cec..6767d96 100644
@@ -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;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 hwrng: bcm2835: Handle deferred clock properly

Quoted 6 lines · Stefan Wahren

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")

Thanks Stephan!

Signature · 1 line
Florian
maintainer
#2 lore raw

PATCH 1/1 hwrng: bcm2835: Handle deferred clock properly

In reply to Stefan Wahren
Quoted 6 lines · Stefan Wahren

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")

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt