diff --git a/ac108.c b/ac108.c index 9709cb8..18c987f 100644 --- a/ac108.c +++ b/ac108.c @@ -1410,7 +1410,15 @@ static const struct regmap_config ac108_regmap = { .max_register = 0xDF, .cache_type = REGCACHE_FLAT, }; -static int ac108_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *i2c_id) { +static const struct i2c_device_id ac108_i2c_id[] = { + { "ac108_0", 0 }, + { "ac108_1", 1 }, + { "ac108_2", 2 }, + { "ac108_3", 3 }, + { "ac101", AC101_I2C_ID }, + { } +}; +static int ac108_i2c_probe(struct i2c_client *i2c) { struct device_node *np = i2c->dev.of_node; unsigned int val = 0; int ret = 0, index; @@ -1423,11 +1431,11 @@ static int ac108_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *i } } - index = (int)i2c_id->driver_data; + index = (int)i2c_match_id(ac108_i2c_id, i2c)->driver_data; if (index == AC101_I2C_ID) { ac10x->i2c101 = i2c; i2c_set_clientdata(i2c, ac10x); - ret = ac101_probe(i2c, i2c_id); + ret = ac101_probe(i2c, i2c_match_id(ac108_i2c_id, i2c)); if (ret) { ac10x->i2c101 = NULL; return ret; @@ -1520,14 +1528,6 @@ __ret: } } -static const struct i2c_device_id ac108_i2c_id[] = { - { "ac108_0", 0 }, - { "ac108_1", 1 }, - { "ac108_2", 2 }, - { "ac108_3", 3 }, - { "ac101", AC101_I2C_ID }, - { } -}; MODULE_DEVICE_TABLE(i2c, ac108_i2c_id); static const struct of_device_id ac108_of_match[] = { diff --git a/wm8960.c b/wm8960.c index 28ade11..187df65 100644 --- a/wm8960.c +++ b/wm8960.c @@ -1318,8 +1318,7 @@ static void wm8960_set_pdata_from_of(struct i2c_client *i2c, pdata->shared_lrclk = true; } -static int wm8960_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) +static int wm8960_i2c_probe(struct i2c_client *i2c) { struct wm8960_data *pdata = dev_get_platdata(&i2c->dev); struct wm8960_priv *wm8960;