Skip to content

Commit

Permalink
i2c: print correct device invalid address
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: b4e2f6a ("i2c: apply DT flags when probing")
Cc: stable@kernel.org
  • Loading branch information
John Garry authored and Wolfram Sang committed Jan 12, 2017
1 parent 331c342 commit 6f724fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,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);
}

Expand Down

0 comments on commit 6f724fb

Please sign in to comment.