summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2012-07-16 15:48:11 +0800
committerTerry Lv <r65388@freescale.com>2012-07-25 13:11:00 +0800
commit751d7a160ed0fc4b6587102d868766e3f667f973 (patch)
tree460425ef21de866cae9307d17f540f93f34d5122 /drivers/char
parentad537f734b64e47fb890a87db54108f2b35a9815 (diff)
ENGR00217306-1: Add DCP/RNGB driver support
This patch will add driver menu support. And also, for rng don't need to enable clock, we add operation when no clock is specified for rng. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/fsl-rngc.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/char/hw_random/fsl-rngc.c b/drivers/char/hw_random/fsl-rngc.c
index 58f0afb2dcdc..5efe810b1aab 100644
--- a/drivers/char/hw_random/fsl-rngc.c
+++ b/drivers/char/hw_random/fsl-rngc.c
@@ -1,7 +1,7 @@
/*
* RNG driver for Freescale RNGC
*
- * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2008-2012 Freescale Semiconductor, Inc.
*/
/*
@@ -123,7 +123,7 @@ static struct platform_device *rng_dev;
int irq_rng;
-static int fsl_rngc_data_present(struct hwrng *rng)
+static int fsl_rngc_data_present(struct hwrng *rng, int wait)
{
int level;
u32 rngc_base = (u32) rng->priv;
@@ -135,7 +135,7 @@ static int fsl_rngc_data_present(struct hwrng *rng)
return level > 0 ? 1 : 0;
}
-static int fsl_rngc_data_read(struct hwrng *rng, u32 * data)
+static int fsl_rngc_data_read(struct hwrng *rng, u32 *data)
{
int err;
u32 rngc_base = (u32) rng->priv;
@@ -293,13 +293,10 @@ static int __init fsl_rngc_probe(struct platform_device *pdev)
clk = clk_get(&pdev->dev, "rng_clk");
- if (IS_ERR(clk)) {
- dev_err(&pdev->dev, "Can not get rng_clk\n");
- err = PTR_ERR(clk);
- return err;
- }
-
- clk_enable(clk);
+ if (IS_ERR(clk))
+ dev_warn(&pdev->dev, "No rng_clk specified\n");
+ else
+ clk_enable(clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -340,7 +337,7 @@ static int __exit fsl_rngc_remove(struct platform_device *pdev)
clk = clk_get(&pdev->dev, "rng_clk");
if (IS_ERR(clk))
- dev_err(&pdev->dev, "Can not get rng_clk\n");
+ dev_warn(&pdev->dev, "No rng_clk specified\n");
else
clk_disable(clk);