mfd: max77686: Don't attempt to get i2c_device_id .data
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 13 Jan 2017 13:34:05 +0000 (10:34 -0300)
committerLee Jones <lee.jones@linaro.org>
Mon, 13 Feb 2017 09:29:43 +0000 (09:29 +0000)
The driver is only used in platforms that have DT support so always the
I2C device .data will be get from the matched OF node and never will be
from the I2C device ID table.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/max77686.c

index 7b68ed72e9cbfcc541d4d1f50a42b7d63d3bdbd6..ddae3bf3e46cfb325f7197c59cfb197fcb0e64e5 100644 (file)
@@ -188,14 +188,11 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
        if (!max77686)
                return -ENOMEM;
 
-       if (i2c->dev.of_node) {
-               match = of_match_node(max77686_pmic_dt_match, i2c->dev.of_node);
-               if (!match)
-                       return -EINVAL;
-
-               max77686->type = (unsigned long)match->data;
-       } else
-               max77686->type = id->driver_data;
+       match = of_match_node(max77686_pmic_dt_match, i2c->dev.of_node);
+       if (!match)
+               return -EINVAL;
+
+       max77686->type = (unsigned long)match->data;
 
        i2c_set_clientdata(i2c, max77686);
        max77686->dev = &i2c->dev;