|
|
60e2723 |
From patchwork Mon Feb 12 20:11:36 2018
|
|
|
60e2723 |
Content-Type: text/plain; charset="utf-8"
|
|
|
60e2723 |
MIME-Version: 1.0
|
|
|
60e2723 |
Content-Transfer-Encoding: 7bit
|
|
|
60e2723 |
Subject: hwrng: bcm2835: Handle deferred clock properly
|
|
|
60e2723 |
From: Stefan Wahren <stefan.wahren@i2se.com>
|
|
|
60e2723 |
X-Patchwork-Id: 10214385
|
|
|
60e2723 |
Message-Id: <1518466296-30161-1-git-send-email-stefan.wahren@i2se.com>
|
|
|
60e2723 |
To: Herbert Xu <herbert@gondor.apana.org.au>, Matt Mackall <mpm@selenic.com>
|
|
|
60e2723 |
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
|
|
|
60e2723 |
Florian Fainelli <f.fainelli@gmail.com>, Arnd Bergmann <arnd@arndb.de>,
|
|
|
60e2723 |
Scott Branden <sbranden@broadcom.com>, Jon Mason <jonmason@broadcom.com>,
|
|
|
60e2723 |
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
|
|
|
60e2723 |
Eric Anholt <eric@anholt.net>,
|
|
|
60e2723 |
bcm-kernel-feedback-list@broadcom.com, linux-crypto@vger.kernel.org,
|
|
|
60e2723 |
Ray Jui <rjui@broadcom.com>, linux-arm-kernel@lists.infradead.org
|
|
|
60e2723 |
Date: Mon, 12 Feb 2018 21:11:36 +0100
|
|
|
60e2723 |
|
|
|
60e2723 |
In case the probe of the clock is deferred, we would assume it is
|
|
|
60e2723 |
optional. This is wrong, so defer the probe of this driver until
|
|
|
60e2723 |
the clock is available.
|
|
|
60e2723 |
|
|
|
60e2723 |
Fixes: 791af4f4907a ("hwrng: bcm2835 - Manage an optional clock")
|
|
|
60e2723 |
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
|
|
|
60e2723 |
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
|
|
|
60e2723 |
---
|
|
|
60e2723 |
drivers/char/hw_random/bcm2835-rng.c | 2 ++
|
|
|
60e2723 |
1 file changed, 2 insertions(+)
|
|
|
60e2723 |
|
|
|
60e2723 |
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c
|
|
|
60e2723 |
index 7a84cec..6767d96 100644
|
|
|
60e2723 |
--- a/drivers/char/hw_random/bcm2835-rng.c
|
|
|
60e2723 |
+++ b/drivers/char/hw_random/bcm2835-rng.c
|
|
|
60e2723 |
@@ -163,6 +163,8 @@ static int bcm2835_rng_probe(struct platform_device *pdev)
|
|
|
60e2723 |
|
|
|
60e2723 |
/* Clock is optional on most platforms */
|
|
|
60e2723 |
priv->clk = devm_clk_get(dev, NULL);
|
|
|
60e2723 |
+ if (IS_ERR(priv->clk) && PTR_ERR(priv->clk) == -EPROBE_DEFER)
|
|
|
60e2723 |
+ return -EPROBE_DEFER;
|
|
|
60e2723 |
|
|
|
60e2723 |
priv->rng.name = pdev->name;
|
|
|
60e2723 |
priv->rng.init = bcm2835_rng_init;
|