ASoC: wm8904: save model id directly in of_device_id.data
Save 2x unsigned int of .rodata. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2bb853f6f9
commit
fb82c6ed31
|
@ -2108,16 +2108,13 @@ static const struct regmap_config wm8904_regmap = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
static enum wm8904_type wm8904_data = WM8904;
|
|
||||||
static enum wm8904_type wm8912_data = WM8912;
|
|
||||||
|
|
||||||
static const struct of_device_id wm8904_of_match[] = {
|
static const struct of_device_id wm8904_of_match[] = {
|
||||||
{
|
{
|
||||||
.compatible = "wlf,wm8904",
|
.compatible = "wlf,wm8904",
|
||||||
.data = &wm8904_data,
|
.data = (void *)WM8904,
|
||||||
}, {
|
}, {
|
||||||
.compatible = "wlf,wm8912",
|
.compatible = "wlf,wm8912",
|
||||||
.data = &wm8912_data,
|
.data = (void *)WM8912,
|
||||||
}, {
|
}, {
|
||||||
/* sentinel */
|
/* sentinel */
|
||||||
}
|
}
|
||||||
|
@ -2158,7 +2155,7 @@ static int wm8904_i2c_probe(struct i2c_client *i2c,
|
||||||
match = of_match_node(wm8904_of_match, i2c->dev.of_node);
|
match = of_match_node(wm8904_of_match, i2c->dev.of_node);
|
||||||
if (match == NULL)
|
if (match == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
wm8904->devtype = *((enum wm8904_type *)match->data);
|
wm8904->devtype = (enum wm8904_type)match->data;
|
||||||
} else {
|
} else {
|
||||||
wm8904->devtype = id->driver_data;
|
wm8904->devtype = id->driver_data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue