i2c: zx2967: always use the same device when printing errors
authorWolfram Sang <wsa@the-dreams.de>
Fri, 23 Jun 2017 19:05:30 +0000 (21:05 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 27 Jun 2017 21:21:00 +0000 (23:21 +0200)
Let's always use the platform device for dev_* and not sometimes the
adapter device as well. Also fix this checkpatch check:

CHECK: Macro argument 'i2c' may be better as '(i2c)' to avoid precedence issues

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-zx2967.c

index 3e381edc0f223a3e5194c2e831af021d97d7e851..48281c1b30c6d56892cac6ad7388386aad586476 100644 (file)
@@ -53,7 +53,7 @@
 
 #define I2C_TIMEOUT                    msecs_to_jiffies(1000)
 
-#define DEV(i2c)                       (&i2c->adap.dev)
+#define DEV(i2c)                       ((i2c)->adap.dev.parent)
 
 struct zx2967_i2c {
        struct i2c_adapter      adap;