summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2018-12-19 15:11:16 -0500
committerMark Brown <broonie@kernel.org>2019-01-03 11:34:05 -0500
commitfb82c6ed31902e651cc9324108f507babfabc890 (patch)
tree3c1a4a7f9e823eaa8c034f39d32abe5d7dd723d3
parent2bb853f6f93775dc4dd4683a42f6934700d90d07 (diff)
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>
-rw-r--r--sound/soc/codecs/wm8904.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 2a3e5fbd04e4..9283a2dc70aa 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -2108,16 +2108,13 @@ static const struct regmap_config wm8904_regmap = {
2108}; 2108};
2109 2109
2110#ifdef CONFIG_OF 2110#ifdef CONFIG_OF
2111static enum wm8904_type wm8904_data = WM8904;
2112static enum wm8904_type wm8912_data = WM8912;
2113
2114static const struct of_device_id wm8904_of_match[] = { 2111static const struct of_device_id wm8904_of_match[] = {
2115 { 2112 {
2116 .compatible = "wlf,wm8904", 2113 .compatible = "wlf,wm8904",
2117 .data = &wm8904_data, 2114 .data = (void *)WM8904,
2118 }, { 2115 }, {
2119 .compatible = "wlf,wm8912", 2116 .compatible = "wlf,wm8912",
2120 .data = &wm8912_data, 2117 .data = (void *)WM8912,
2121 }, { 2118 }, {
2122 /* sentinel */ 2119 /* sentinel */
2123 } 2120 }
@@ -2158,7 +2155,7 @@ static int wm8904_i2c_probe(struct i2c_client *i2c,
2158 match = of_match_node(wm8904_of_match, i2c->dev.of_node); 2155 match = of_match_node(wm8904_of_match, i2c->dev.of_node);
2159 if (match == NULL) 2156 if (match == NULL)
2160 return -EINVAL; 2157 return -EINVAL;
2161 wm8904->devtype = *((enum wm8904_type *)match->data); 2158 wm8904->devtype = (enum wm8904_type)match->data;
2162 } else { 2159 } else {
2163 wm8904->devtype = id->driver_data; 2160 wm8904->devtype = id->driver_data;
2164 } 2161 }