i2c: print correct device invalid address
authorJohn Garry <john.garry@huawei.com>
Fri, 6 Jan 2017 11:02:57 +0000 (19:02 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 12 Jan 2017 19:06:15 +0000 (20:06 +0100)
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: b4e2f6ac1281 ("i2c: apply DT flags when probing")
Cc: stable@kernel.org
drivers/i2c/i2c-core.c

index 7b117240f1ea4a6cbb9f25dbdbf7cfb140bb4a85..c26296c2eac5f39f4af144db17f1ffd1523dbbb2 100644 (file)
@@ -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);
        }