diff mbox

[1/6] mmc: sh-mmcif: print bus clock rate on probe

Message ID 1396347954-13740-2-git-send-email-ben.dooks@codethink.co.uk (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Ben Dooks April 1, 2014, 10:25 a.m. UTC
Add a print to show the host-bus clock rate for mmcif on probe to allow
easy check on what clock rate the bus clock is at.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 drivers/mmc/host/sh_mmcif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven April 1, 2014, 10:45 a.m. UTC | #1
On Tue, Apr 1, 2014 at 12:25 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> -       dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
> +       dev_info(&pdev->dev, "driver version %s, clock rate %ldMHz\n",
> +                DRIVER_VERSION, clk_get_rate(host->hclk) / 1000000);

%lu (soon the clocks won't fit in unsigned 32-bit anymore, though...)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart April 1, 2014, 11:08 a.m. UTC | #2
Hi Ben,

Thank you for the patch.

On Tuesday 01 April 2014 11:25:49 Ben Dooks wrote:
> Add a print to show the host-bus clock rate for mmcif on probe to allow
> easy check on what clock rate the bus clock is at.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  drivers/mmc/host/sh_mmcif.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index e8713d7..c48df98 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -1477,7 +1477,8 @@ static int sh_mmcif_probe(struct platform_device
> *pdev)
> 
>  	dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
> 
> -	dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
> +	dev_info(&pdev->dev, "driver version %s, clock rate %ldMHz\n",
> +		 DRIVER_VERSION, clk_get_rate(host->hclk) / 1000000);
>  	dev_dbg(&pdev->dev, "chip ver H'%04x\n",
>  		sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
>  	return ret;

Given that DRIVER_VERSION is defined as "2010-04-28", I'd take this as an 
opportunity to remove it completely. You could combine the dev_info and 
dev_dbg message into something similar to

	dev_info(&pdev->dev, "Chip version 0x%04x found, clock rate %luMHz\n",
		 sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0xffff,
 		 clk_get_rate(host->hclk) / 1000000);
Ben Dooks April 1, 2014, 11:37 a.m. UTC | #3
On 01/04/14 12:08, Laurent Pinchart wrote:
> Hi Ben,
>
> Thank you for the patch.
>
> On Tuesday 01 April 2014 11:25:49 Ben Dooks wrote:
>> Add a print to show the host-bus clock rate for mmcif on probe to allow
>> easy check on what clock rate the bus clock is at.
>>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>>   drivers/mmc/host/sh_mmcif.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
>> index e8713d7..c48df98 100644
>> --- a/drivers/mmc/host/sh_mmcif.c
>> +++ b/drivers/mmc/host/sh_mmcif.c
>> @@ -1477,7 +1477,8 @@ static int sh_mmcif_probe(struct platform_device
>> *pdev)
>>
>>   	dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
>>
>> -	dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
>> +	dev_info(&pdev->dev, "driver version %s, clock rate %ldMHz\n",
>> +		 DRIVER_VERSION, clk_get_rate(host->hclk) / 1000000);
>>   	dev_dbg(&pdev->dev, "chip ver H'%04x\n",
>>   		sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
>>   	return ret;
>
> Given that DRIVER_VERSION is defined as "2010-04-28", I'd take this as an
> opportunity to remove it completely. You could combine the dev_info and
> dev_dbg message into something similar to

Ok, changed to use this.
diff mbox

Patch

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index e8713d7..c48df98 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1477,7 +1477,8 @@  static int sh_mmcif_probe(struct platform_device *pdev)
 
 	dev_pm_qos_expose_latency_limit(&pdev->dev, 100);
 
-	dev_info(&pdev->dev, "driver version %s\n", DRIVER_VERSION);
+	dev_info(&pdev->dev, "driver version %s, clock rate %ldMHz\n",
+		 DRIVER_VERSION, clk_get_rate(host->hclk) / 1000000);
 	dev_dbg(&pdev->dev, "chip ver H'%04x\n",
 		sh_mmcif_readl(host->addr, MMCIF_CE_VERSION) & 0x0000ffff);
 	return ret;