crypto: add clk_prepare/clk_unprepare
authorPrashant Gaikwad <pgaikwad@nvidia.com>
Tue, 5 Jun 2012 04:29:43 +0000 (09:59 +0530)
committerStephen Warren <swarren@nvidia.com>
Tue, 12 Jun 2012 16:32:57 +0000 (10:32 -0600)
Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/tegra-aes.c

index 422a9766c7c9f68b742302d710a79bc578e57aee..ac236f6724f4bf11d1130b1258af8eff0b731044 100644 (file)
@@ -572,7 +572,7 @@ static void aes_workqueue_handler(struct work_struct *work)
        struct tegra_aes_dev *dd = aes_dev;
        int ret;
 
-       ret = clk_enable(dd->aes_clk);
+       ret = clk_prepare_enable(dd->aes_clk);
        if (ret)
                BUG_ON("clock enable failed");
 
@@ -581,7 +581,7 @@ static void aes_workqueue_handler(struct work_struct *work)
                ret = tegra_aes_handle_req(dd);
        } while (!ret);
 
-       clk_disable(dd->aes_clk);
+       clk_disable_unprepare(dd->aes_clk);
 }
 
 static irqreturn_t aes_irq(int irq, void *dev_id)
@@ -673,7 +673,7 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata,
        /* take mutex to access the aes hw */
        mutex_lock(&aes_lock);
 
-       ret = clk_enable(dd->aes_clk);
+       ret = clk_prepare_enable(dd->aes_clk);
        if (ret)
                return ret;
 
@@ -700,7 +700,7 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata,
        }
 
 out:
-       clk_disable(dd->aes_clk);
+       clk_disable_unprepare(dd->aes_clk);
        mutex_unlock(&aes_lock);
 
        dev_dbg(dd->dev, "%s: done\n", __func__);
@@ -758,7 +758,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed,
 
        dd->flags = FLAGS_ENCRYPT | FLAGS_RNG;
 
-       ret = clk_enable(dd->aes_clk);
+       ret = clk_prepare_enable(dd->aes_clk);
        if (ret)
                return ret;
 
@@ -788,7 +788,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed,
        memcpy(dd->dt, dt, DEFAULT_RNG_BLK_SZ);
 
 out:
-       clk_disable(dd->aes_clk);
+       clk_disable_unprepare(dd->aes_clk);
        mutex_unlock(&aes_lock);
 
        dev_dbg(dd->dev, "%s: done\n", __func__);