diff mbox

[3/4] mmc: davinci: prepare clock

Message ID 1457567405-30475-4-git-send-email-david@lechnology.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Lechner March 9, 2016, 11:50 p.m. UTC
When trying to use this driver with the common clock framework, enabling
the clock fails because it was not prepared. This fixes the problem by
calling clk_prepare and clk_enable in a single function.

Signed-off-by: David Lechner <david@lechnology.com>
---
 drivers/mmc/host/davinci_mmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sekhar Nori March 14, 2016, 11:54 a.m. UTC | #1
On Thursday 10 March 2016 05:20 AM, David Lechner wrote:
> When trying to use this driver with the common clock framework, enabling
> the clock fails because it was not prepared. This fixes the problem by
> calling clk_prepare and clk_enable in a single function.
> 
> Signed-off-by: David Lechner <david@lechnology.com>

Patch looks good. But I wonder how you hit this issue since we dont use
common clock framework on mach-davinci and this driver is not used
anywhere else AFAIK.

Regards,
Sekhar
David Lechner March 14, 2016, 5:09 p.m. UTC | #2
On 03/14/2016 06:54 AM, Sekhar Nori wrote:
> On Thursday 10 March 2016 05:20 AM, David Lechner wrote:
>> When trying to use this driver with the common clock framework, enabling
>> the clock fails because it was not prepared. This fixes the problem by
>> calling clk_prepare and clk_enable in a single function.
>>
>> Signed-off-by: David Lechner <david@lechnology.com>
> Patch looks good. But I wonder how you hit this issue since we dont use
> common clock framework on mach-davinci and this driver is not used
> anywhere else AFAIK.
>
> Regards,
> Sekhar
>
Because I am working towards getting the common clock framework working 
on mach-davinci - at least with da8xx/device tree. :-)
David Lechner March 14, 2016, 5:13 p.m. UTC | #3
On 03/14/2016 12:09 PM, David Lechner wrote:
> On 03/14/2016 06:54 AM, Sekhar Nori wrote:
>> On Thursday 10 March 2016 05:20 AM, David Lechner wrote:
>>> When trying to use this driver with the common clock framework, enabling
>>> the clock fails because it was not prepared. This fixes the problem by
>>> calling clk_prepare and clk_enable in a single function.
>>>
>>> Signed-off-by: David Lechner <david@lechnology.com>
>> Patch looks good. But I wonder how you hit this issue since we dont use
>> common clock framework on mach-davinci and this driver is not used
>> anywhere else AFAIK.
>>
>> Regards,
>> Sekhar
>>
> Because I am working towards getting the common clock framework working
> on mach-davinci - at least with da8xx/device tree. :-)

I should also mention that I did test using the existing mach-davinci 
clocks as well.
Sekhar Nori March 15, 2016, 5:16 a.m. UTC | #4
On Monday 14 March 2016 10:39 PM, David Lechner wrote:
> On 03/14/2016 06:54 AM, Sekhar Nori wrote:
>> On Thursday 10 March 2016 05:20 AM, David Lechner wrote:
>>> When trying to use this driver with the common clock framework, enabling
>>> the clock fails because it was not prepared. This fixes the problem by
>>> calling clk_prepare and clk_enable in a single function.
>>>
>>> Signed-off-by: David Lechner <david@lechnology.com>
>> Patch looks good. But I wonder how you hit this issue since we dont use
>> common clock framework on mach-davinci and this driver is not used
>> anywhere else AFAIK.
>>
>> Regards,
>> Sekhar
>>
> Because I am working towards getting the common clock framework working
> on mach-davinci - at least with da8xx/device tree. :-)

Alright, glad to know someone is pursuing this.

Thanks,
Sekhar
diff mbox

Patch

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index f571549..b160feb 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1283,9 +1283,9 @@  static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 		ret = PTR_ERR(host->clk);
 		goto clk_get_fail;
 	}
-	ret = clk_enable(host->clk);
+	ret = clk_prepare_enable(host->clk);
 	if (ret)
-		goto clk_enable_fail;
+		goto clk_prepare_enable_fail;
 
 	host->mmc_input_clk = clk_get_rate(host->clk);
 
@@ -1384,7 +1384,7 @@  mmc_add_host_fail:
 cpu_freq_fail:
 	davinci_release_dma_channels(host);
 	clk_disable(host->clk);
-clk_enable_fail:
+clk_prepare_enable_fail:
 	clk_put(host->clk);
 clk_get_fail:
 	iounmap(host->base);