linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: print correct device invalid address
@ 2017-01-06 11:02 John Garry
  2017-01-07 21:43 ` Vladimir Zapolskiy
  2017-01-12 19:07 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2017-01-06 11:02 UTC (permalink / raw)
  To: wsa; +Cc: linux-i2c, linux-kernel, linuxarm, John Garry

In of_i2c_register_device(), when the check for
device address validity fails we print the info.addr,
which has not been assigned properly.

Fix this by printing the actual invalid address.

Signed-off-by: John Garry <john.garry@huawei.com>

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index cf9e396..03cfcdd 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1708,7 +1708,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
 
 	if (i2c_check_addr_validity(addr, info.flags)) {
 		dev_err(&adap->dev, "of_i2c: invalid addr=%x on %s\n",
-			info.addr, node->full_name);
+			addr, node->full_name);
 		return ERR_PTR(-EINVAL);
 	}
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: print correct device invalid address
  2017-01-06 11:02 [PATCH] i2c: print correct device invalid address John Garry
@ 2017-01-07 21:43 ` Vladimir Zapolskiy
  2017-01-12 19:07 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Zapolskiy @ 2017-01-07 21:43 UTC (permalink / raw)
  To: John Garry, wsa; +Cc: linux-i2c, linux-kernel, linuxarm

On 01/06/2017 01:02 PM, John Garry wrote:
> In of_i2c_register_device(), when the check for
> device address validity fails we print the info.addr,
> which has not been assigned properly.
> 
> Fix this by printing the actual invalid address.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index cf9e396..03cfcdd 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1708,7 +1708,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
>  
>  	if (i2c_check_addr_validity(addr, info.flags)) {
>  		dev_err(&adap->dev, "of_i2c: invalid addr=%x on %s\n",
> -			info.addr, node->full_name);
> +			addr, node->full_name);
>  		return ERR_PTR(-EINVAL);
>  	}
>  
> 

Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Fixes: b4e2f6ac1281 ("i2c: apply DT flags when probing")

Thank you for the fix.

--
With best wishes,
Vladimir

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: print correct device invalid address
  2017-01-06 11:02 [PATCH] i2c: print correct device invalid address John Garry
  2017-01-07 21:43 ` Vladimir Zapolskiy
@ 2017-01-12 19:07 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-01-12 19:07 UTC (permalink / raw)
  To: John Garry; +Cc: linux-i2c, linux-kernel, linuxarm

On Fri, Jan 06, 2017 at 07:02:57PM +0800, John Garry wrote:
> In of_i2c_register_device(), when the check for
> device address validity fails we print the info.addr,
> which has not been assigned properly.
> 
> Fix this by printing the actual invalid address.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>

Applied to for-current, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-12 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06 11:02 [PATCH] i2c: print correct device invalid address John Garry
2017-01-07 21:43 ` Vladimir Zapolskiy
2017-01-12 19:07 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).