Re: [U-Boot] [PATCH 15/30] dm: sound: wm8994: Drop g_codec_info and g_wm8994_info

2018-12-09 Thread sjg
These are only used in two functions so can be made local.

Signed-off-by: Simon Glass 
---

 drivers/sound/wm8994.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

Applied to u-boot-dm/master
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 15/30] dm: sound: wm8994: Drop g_codec_info and g_wm8994_info

2018-12-03 Thread Simon Glass
These are only used in two functions so can be made local.

Signed-off-by: Simon Glass 
---

 drivers/sound/wm8994.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/sound/wm8994.c b/drivers/sound/wm8994.c
index a79f46bcc3a..be27e2b1e7e 100644
--- a/drivers/sound/wm8994.c
+++ b/drivers/sound/wm8994.c
@@ -61,9 +61,6 @@ static int bclk_divs[] = {
640, 880, 960, 1280, 1760, 1920
 };
 
-static struct wm8994_priv g_wm8994_info;
-static struct sound_codec_info g_codec_info;
-
 /*
  * Initialise I2C for wm 8994
  *
@@ -909,24 +906,25 @@ int wm8994_init(const void *blob, enum en_audio_interface 
aif_id,
int sampling_rate, int mclk_freq, int bits_per_sample,
unsigned int channels)
 {
-   struct sound_codec_info *pcodec_info = _codec_info;
+   struct sound_codec_info pcodec_info;
+   struct wm8994_priv wm8994_info;
int ret;
 
/* Get the codec Values */
-   if (get_codec_values(pcodec_info, blob) < 0) {
+   if (get_codec_values(_info, blob) < 0) {
debug("FDT Codec values failed\n");
return -1;
}
 
/* shift the device address by 1 for 7 bit addressing */
-   g_wm8994_info.i2c_addr = pcodec_info->i2c_dev_addr;
-   wm8994_i2c_init(pcodec_info->i2c_bus);
-   ret = wm8994_device_init(_wm8994_info);
+   wm8994_info.i2c_addr = pcodec_info.i2c_dev_addr;
+   wm8994_i2c_init(pcodec_info.i2c_bus);
+   ret = wm8994_device_init(_info);
if (ret < 0) {
debug("%s: wm8994 codec chip init failed\n", __func__);
return ret;
}
 
-   return _wm8994_init(_wm8994_info, aif_id, sampling_rate, mclk_freq,
+   return _wm8994_init(_info, aif_id, sampling_rate, mclk_freq,
bits_per_sample, channels);
 }
-- 
2.20.0.rc1.387.gf8505762e3-goog

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot