diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-07-21 13:41:38 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-07-31 20:53:59 -0400 |
commit | 9e01d0c6f63a59cc756c0028e17effdbadee7227 (patch) | |
tree | 04112025335600ae0c09f647803c55ef094db383 /drivers/char/hw_random | |
parent | 69d2884debaa029ddcf9de4631c4c83249bc8c4d (diff) |
hwrng: mxc-rnga - Check the return value from clk_prepare_enable()
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r-- | drivers/char/hw_random/mxc-rnga.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/hw_random/mxc-rnga.c b/drivers/char/hw_random/mxc-rnga.c index 19a12ac64a9e..6a86b6f56af2 100644 --- a/drivers/char/hw_random/mxc-rnga.c +++ b/drivers/char/hw_random/mxc-rnga.c | |||
@@ -164,7 +164,9 @@ static int __init mxc_rnga_probe(struct platform_device *pdev) | |||
164 | goto out; | 164 | goto out; |
165 | } | 165 | } |
166 | 166 | ||
167 | clk_prepare_enable(mxc_rng->clk); | 167 | err = clk_prepare_enable(mxc_rng->clk); |
168 | if (err) | ||
169 | goto out; | ||
168 | 170 | ||
169 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 171 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
170 | mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res); | 172 | mxc_rng->mem = devm_ioremap_resource(&pdev->dev, res); |