diff mbox series

[3/4] ASoC: wm8904: save model id directly in of_device_id.data

Message ID 30114be8a4e9eda7c6b2a6f555397f51f9a389f8.1545249666.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State Accepted
Commit fb82c6ed31902e651cc9324108f507babfabc890
Headers show
Series ASoC: wm8904: prepare for use from audio-graph-card | expand

Commit Message

Michał Mirosław Dec. 19, 2018, 8:11 p.m. UTC
Save 2x unsigned int of .rodata.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 sound/soc/codecs/wm8904.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Charles Keepax Dec. 21, 2018, 11:27 a.m. UTC | #1
On Wed, Dec 19, 2018 at 09:11:16PM +0100, Michał Mirosław wrote:
> 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>

Thanks,
Charles
diff mbox series

Patch

diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index f8a17fcdfdeb..2813b7f6a58e 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -2123,16 +2123,13 @@  static const struct regmap_config wm8904_regmap = {
 };
 
 #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[] = {
 	{
 		.compatible = "wlf,wm8904",
-		.data = &wm8904_data,
+		.data = (void *)WM8904,
 	}, {
 		.compatible = "wlf,wm8912",
-		.data = &wm8912_data,
+		.data = (void *)WM8912,
 	}, {
 		/* sentinel */
 	}
@@ -2173,7 +2170,7 @@  static int wm8904_i2c_probe(struct i2c_client *i2c,
 		match = of_match_node(wm8904_of_match, i2c->dev.of_node);
 		if (match == NULL)
 			return -EINVAL;
-		wm8904->devtype = *((enum wm8904_type *)match->data);
+		wm8904->devtype = (enum wm8904_type)match->data;
 	} else {
 		wm8904->devtype = id->driver_data;
 	}