[alsa-devel] [PATCH 2/2] sound: soc: wm8903: Cut gpio_base data

Linus Walleij linus.walleij at linaro.org
Tue Sep 18 21:12:33 CEST 2018


This variable is only used inside the file, and we should
never hard-code the GPIO base, so delete this.

Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 sound/soc/codecs/wm8903.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 23e43ff40ded..545512dc4c45 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -144,7 +144,6 @@ struct wm8903_platform_data {
 
 	int micdet_delay;      /* Delay after microphone detection (ms) */
 
-	int gpio_base;
 	u32 gpio_cfg[WM8903_NUM_GPIO]; /* Default register values for GPIO pin mux */
 };
 
@@ -1876,17 +1875,12 @@ static const struct gpio_chip wm8903_template_chip = {
 
 static void wm8903_init_gpio(struct wm8903_priv *wm8903)
 {
-	struct wm8903_platform_data *pdata = wm8903->pdata;
 	int ret;
 
 	wm8903->gpio_chip = wm8903_template_chip;
 	wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO;
 	wm8903->gpio_chip.parent = wm8903->dev;
-
-	if (pdata->gpio_base)
-		wm8903->gpio_chip.base = pdata->gpio_base;
-	else
-		wm8903->gpio_chip.base = -1;
+	wm8903->gpio_chip.base = -1;
 
 	ret = gpiochip_add_data(&wm8903->gpio_chip, wm8903);
 	if (ret != 0)
-- 
2.17.1



More information about the Alsa-devel mailing list