[1/2] i2c: designware: Print clock freq on invalid clock freq error

Submitted by Hans de Goede on July 8, 2017, 1:10 p.m.

Details

Message ID 20170708131052.13524-1-hdegoede@redhat.com
State New
Headers show

Commit Message

Hans de Goede July 8, 2017, 1:10 p.m.
When we refuse to probe due to an invalid clock frequency, log
the frequency which is causing this error.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andy Shevchenko July 8, 2017, 1:54 p.m.
On Sat, 2017-07-08 at 15:10 +0200, Hans de Goede wrote:
> When we refuse to probe due to an invalid clock frequency, log
> the frequency which is causing this error.

Shouldn't it have \n as well?

> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index d1263b82d646..d5acaf8d65bf 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -275,7 +275,8 @@ static int dw_i2c_plat_probe(struct
> platform_device *pdev)
>  	if (dev->clk_freq != 100000 && dev->clk_freq != 400000
>  	    && dev->clk_freq != 1000000 && dev->clk_freq != 3400000)
> {
>  		dev_err(&pdev->dev,
> -			"Only 100kHz, 400kHz, 1MHz and 3.4MHz
> supported");
> +			"%d Hz is unsupported, only 100kHz, 400kHz,
> 1MHz and 3.4MHz are supported",
> +			dev->clk_freq);
>  		r = -EINVAL;
>  		goto exit_reset;
>  	}
Hans de Goede July 9, 2017, 6:53 p.m.
Hi,

On 08-07-17 15:54, Andy Shevchenko wrote:
> On Sat, 2017-07-08 at 15:10 +0200, Hans de Goede wrote:
>> When we refuse to probe due to an invalid clock frequency, log
>> the frequency which is causing this error.
> 
> Shouldn't it have \n as well?

Right will fix for v2.

Regards,

Hans


> 
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
>> b/drivers/i2c/busses/i2c-designware-platdrv.c
>> index d1263b82d646..d5acaf8d65bf 100644
>> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
>> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
>> @@ -275,7 +275,8 @@ static int dw_i2c_plat_probe(struct
>> platform_device *pdev)
>>   	if (dev->clk_freq != 100000 && dev->clk_freq != 400000
>>   	    && dev->clk_freq != 1000000 && dev->clk_freq != 3400000)
>> {
>>   		dev_err(&pdev->dev,
>> -			"Only 100kHz, 400kHz, 1MHz and 3.4MHz
>> supported");
>> +			"%d Hz is unsupported, only 100kHz, 400kHz,
>> 1MHz and 3.4MHz are supported",
>> +			dev->clk_freq);
>>   		r = -EINVAL;
>>   		goto exit_reset;
>>   	}
>

Patch hide | download patch | download mbox

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index d1263b82d646..d5acaf8d65bf 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -275,7 +275,8 @@  static int dw_i2c_plat_probe(struct platform_device *pdev)
 	if (dev->clk_freq != 100000 && dev->clk_freq != 400000
 	    && dev->clk_freq != 1000000 && dev->clk_freq != 3400000) {
 		dev_err(&pdev->dev,
-			"Only 100kHz, 400kHz, 1MHz and 3.4MHz supported");
+			"%d Hz is unsupported, only 100kHz, 400kHz, 1MHz and 3.4MHz are supported",
+			dev->clk_freq);
 		r = -EINVAL;
 		goto exit_reset;
 	}