From: Ulf Hansson Subject: Re: [PATCH 36/63] crypto: ux500/hash - Prepare clock before enabling it Date: Wed, 8 May 2013 15:59:08 +0200 Message-ID: References: <1367591569-32197-1-git-send-email-lee.jones@linaro.org> <1367591569-32197-37-git-send-email-lee.jones@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arnd@arndb.de, linus.walleij@stericsson.com, srinidhi.kasagar@stericsson.com, Herbert Xu , "David S. Miller" , Andreas Westin , linux-crypto@vger.kernel.org To: Lee Jones Return-path: Received: from mail-vc0-f178.google.com ([209.85.220.178]:53865 "EHLO mail-vc0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755482Ab3EHN7J (ORCPT ); Wed, 8 May 2013 09:59:09 -0400 Received: by mail-vc0-f178.google.com with SMTP id kw10so1677974vcb.9 for ; Wed, 08 May 2013 06:59:08 -0700 (PDT) In-Reply-To: <1367591569-32197-37-git-send-email-lee.jones@linaro.org> Sender: linux-crypto-owner@vger.kernel.org List-ID: On 3 May 2013 16:32, Lee Jones wrote: > If we fail to prepare the ux500-hash clock before enabling it the > platform will fail to boot. Here we insure this happens. > > Cc: Herbert Xu > Cc: David S. Miller > Cc: Andreas Westin > Cc: Ulf Hansson > Cc: linux-crypto@vger.kernel.org > Acked-by: Arnd Bergmann > Signed-off-by: Lee Jones > --- > drivers/crypto/ux500/hash/hash_core.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c > index 632c333..1e8b2f3 100644 > --- a/drivers/crypto/ux500/hash/hash_core.c > +++ b/drivers/crypto/ux500/hash/hash_core.c > @@ -1727,11 +1727,17 @@ static int ux500_hash_probe(struct platform_device *pdev) > goto out_regulator; > } > > + ret = clk_prepare(device_data->clk); > + if (ret) { > + dev_err(dev, "[%s] clk_prepare() failed!", __func__); > + goto out_clk; > + } > + > /* Enable device power (and clock) */ > ret = hash_enable_power(device_data, false); > if (ret) { > dev_err(dev, "[%s]: hash_enable_power() failed!", __func__); > - goto out_clk; > + goto out_clk_unprepare; > } > > ret = hash_check_hw(device_data); > @@ -1763,6 +1769,9 @@ static int ux500_hash_probe(struct platform_device *pdev) > out_power: > hash_disable_power(device_data, false); > > +out_clk_unprepare: > + clk_unprepare(device_data->clk); > + > out_clk: > clk_put(device_data->clk); > > @@ -1827,6 +1836,7 @@ static int ux500_hash_remove(struct platform_device *pdev) > dev_err(dev, "[%s]: hash_disable_power() failed", > __func__); > > + clk_unprepare(device_data->clk); > clk_put(device_data->clk); > regulator_put(device_data->regulator); > > -- > 1.7.10.4 > Acked-by: Ulf Hansson