These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / mfd / arizona-i2c.c
index ff782a5..4e3afd1 100644 (file)
@@ -27,7 +27,7 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
                             const struct i2c_device_id *id)
 {
        struct arizona *arizona;
-       const struct regmap_config *regmap_config;
+       const struct regmap_config *regmap_config = NULL;
        unsigned long type;
        int ret;
 
@@ -37,25 +37,32 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
                type = id->driver_data;
 
        switch (type) {
-#ifdef CONFIG_MFD_WM5102
        case WM5102:
-               regmap_config = &wm5102_i2c_regmap;
+               if (IS_ENABLED(CONFIG_MFD_WM5102))
+                       regmap_config = &wm5102_i2c_regmap;
                break;
-#endif
-#ifdef CONFIG_MFD_WM5110
        case WM5110:
        case WM8280:
-               regmap_config = &wm5110_i2c_regmap;
+               if (IS_ENABLED(CONFIG_MFD_WM5110))
+                       regmap_config = &wm5110_i2c_regmap;
                break;
-#endif
-#ifdef CONFIG_MFD_WM8997
        case WM8997:
-               regmap_config = &wm8997_i2c_regmap;
+               if (IS_ENABLED(CONFIG_MFD_WM8997))
+                       regmap_config = &wm8997_i2c_regmap;
+               break;
+       case WM8998:
+       case WM1814:
+               if (IS_ENABLED(CONFIG_MFD_WM8998))
+                       regmap_config = &wm8998_i2c_regmap;
                break;
-#endif
        default:
-               dev_err(&i2c->dev, "Unknown device type %ld\n",
-                       id->driver_data);
+               dev_err(&i2c->dev, "Unknown device type %ld\n", type);
+               return -EINVAL;
+       }
+
+       if (!regmap_config) {
+               dev_err(&i2c->dev,
+                       "No kernel support for device type %ld\n", type);
                return -EINVAL;
        }
 
@@ -71,7 +78,7 @@ static int arizona_i2c_probe(struct i2c_client *i2c,
                return ret;
        }
 
-       arizona->type = id->driver_data;
+       arizona->type = type;
        arizona->dev = &i2c->dev;
        arizona->irq = i2c->irq;
 
@@ -90,6 +97,8 @@ static const struct i2c_device_id arizona_i2c_id[] = {
        { "wm5110", WM5110 },
        { "wm8280", WM8280 },
        { "wm8997", WM8997 },
+       { "wm8998", WM8998 },
+       { "wm1814", WM1814 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
@@ -97,7 +106,6 @@ MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
 static struct i2c_driver arizona_i2c_driver = {
        .driver = {
                .name   = "arizona",
-               .owner  = THIS_MODULE,
                .pm     = &arizona_pm_ops,
                .of_match_table = of_match_ptr(arizona_of_match),
        },