Skip to contentSkip to conversation

i2c: print correct device invalid address

PATCH Applied John Garry 3 participants 3 messages Jan 6, 2017 – Jan 12, 2017

Subsystems (2)
lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 i2c: print correct device invalid address

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.

drivers/i2c/i2c-core.c +1 -1
index cf9e396..03cfcdd 100644
@@ -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);
 	}
 
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · 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.

drivers/i2c/i2c-core.c +0 -0
index cf9e396..03cfcdd 100644

drivers/i2c/i2c-core.c static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, · line 1714

Quoted 8 lines
drivers/i2c/i2c-core.c +1 -1
@@ -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);
 	}
 
Fixes b4e2f6ac1281 ("i2c: apply DT flags when probing")

Thank you for the fix.

--
With best wishes,
Vladimir

Applied
#2 lore raw
In reply to John Garry
Quoted 7 lines · 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.

Applied to for-current, thanks!