diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-03-22 18:54:52 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-03-22 18:54:52 +0100 |
commit | 7c2b3e0ddc063f61a201ccb70a121fecc8373a49 (patch) | |
tree | 6dfb348a27459cb2058124c1d8417680c194ed54 /drivers/char/hw_random | |
parent | 947b897204c417d22ad90e5f354858d78de15a07 (diff) | |
parent | 916cda1aa1b412d7cf2991c3af7479544942d121 (diff) |
Merge remote-tracking branch 's390/guarded-storage' into kvms390/next
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r-- | drivers/char/hw_random/omap-rng.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index 3ad86fdf954e..b1ad12552b56 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -397,9 +397,8 @@ static int of_get_omap_rng_device_details(struct omap_rng_dev *priv, irq, err); return err; } - omap_rng_write(priv, RNG_INTMASK_REG, RNG_SHUTDOWN_OFLO_MASK); - priv->clk = of_clk_get(pdev->dev.of_node, 0); + priv->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(priv->clk) && PTR_ERR(priv->clk) == -EPROBE_DEFER) return -EPROBE_DEFER; if (!IS_ERR(priv->clk)) { @@ -408,6 +407,19 @@ static int of_get_omap_rng_device_details(struct omap_rng_dev *priv, dev_err(&pdev->dev, "unable to enable the clk, " "err = %d\n", err); } + + /* + * On OMAP4, enabling the shutdown_oflo interrupt is + * done in the interrupt mask register. There is no + * such register on EIP76, and it's enabled by the + * same bit in the control register + */ + if (priv->pdata->regs[RNG_INTMASK_REG]) + omap_rng_write(priv, RNG_INTMASK_REG, + RNG_SHUTDOWN_OFLO_MASK); + else + omap_rng_write(priv, RNG_CONTROL_REG, + RNG_SHUTDOWN_OFLO_MASK); } return 0; } |