Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1552673 > unrolled thread

[PATCH] i2c: print correct device invalid address

Started byJohn Garry <john.garry@huawei.com>
First post2017-01-06 11:40 +0100
Last post2017-01-12 20:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] i2c: print correct device invalid address John Garry <john.garry@huawei.com> - 2017-01-06 11:40 +0100
    Re: [PATCH] i2c: print correct device invalid address Vladimir Zapolskiy <vz@mleia.com> - 2017-01-07 22:50 +0100
    Re: [PATCH] i2c: print correct device invalid address Wolfram Sang <wsa@the-dreams.de> - 2017-01-12 20:10 +0100

#1552673 — [PATCH] i2c: print correct device invalid address

FromJohn Garry <john.garry@huawei.com>
Date2017-01-06 11:40 +0100
Subject[PATCH] i2c: print correct device invalid address
Message-ID<sWA6d-s7-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1553752

FromVladimir Zapolskiy <vz@mleia.com>
Date2017-01-07 22:50 +0100
Message-ID<sX729-5Mo-5@gated-at.bofh.it>
In reply to#1552673
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

[toc] | [prev] | [next] | [standalone]


#1557740

FromWolfram Sang <wsa@the-dreams.de>
Date2017-01-12 20:10 +0100
Message-ID<sYSV4-7KQ-17@gated-at.bofh.it>
In reply to#1552673
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!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web