Arnd Bergmann 576ce4075b
ASoC: wm97xx: fix uninitialized regmap pointer problem
gcc notices that without either the ac97 bus or the pdata, we never
initialize the regmap pointer, which leads to an uninitialized variable
access:

sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':
sound/soc/codecs/wm9712.c:666:2: error: 'regmap' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Since that configuration is invalid, it's better to return an error
here. I tried to avoid adding complexity to the conditions, and turned
the #ifdef into a regular if(IS_ENABLED()) check for readability.
This in turn requires moving some header file declarations out of
an #ifdef.

The same code is used in three drivers, all of which I'm changing
the same way.

Fixes: 2ed1a8e0ce8d ("ASoC: wm9712: add ac97 new bus support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-05 10:37:39 +00:00
..
2011-08-17 00:53:54 +09:00
2014-05-05 18:20:22 -07:00
2015-11-30 12:24:12 +00:00
2012-09-28 14:21:54 +01:00
2017-11-27 16:19:52 -05:00
2014-07-04 18:50:51 +01:00
2015-07-09 12:00:11 +01:00
2016-09-24 19:51:57 +01:00
2015-03-11 12:08:20 +00:00
2018-06-18 12:54:38 +01:00
2017-11-13 15:45:57 +01:00
2018-09-20 10:31:20 -07:00
2014-09-15 15:52:03 +02:00
2011-09-20 16:02:16 +01:00
2011-08-08 14:30:37 +09:00