summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2015-08-05 21:12:54 +0200
committerWolfram Sang <wsa@the-dreams.de>2015-08-24 14:05:16 +0200
commitc6909d6f6f1082b8bb4c1b0ef3460a005c9dcb4d (patch)
treed9de5570c93533a67cb99d42766ac7e35f23362c /drivers/i2c/i2c-core.c
parenti2c: support 10 bit and slave addresses in sysfs 'new_device' (diff)
downloadlinux-c6909d6f6f1082b8bb4c1b0ef3460a005c9dcb4d.tar.xz
linux-c6909d6f6f1082b8bb4c1b0ef3460a005c9dcb4d.zip
i2c: slave: print warning if slave flag not set
Address collisions will be rare, but we should let the user know that slaves have their own address space nonetheless. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 039817eaecb5..a6780289c61d 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -3017,6 +3017,10 @@ int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb)
return -EINVAL;
}
+ if (!(client->flags & I2C_CLIENT_SLAVE))
+ dev_warn(&client->dev, "%s: client slave flag not set. You might see address collisions\n",
+ __func__);
+
if (!(client->flags & I2C_CLIENT_TEN)) {
/* Enforce stricter address checking */
ret = i2c_check_7bit_addr_validity_strict(client->addr);