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

Mark Brown broonie at kernel.org
Tue Sep 18 21:52:20 CEST 2018


On Tue, Sep 18, 2018 at 12:12:33PM -0700, Linus Walleij wrote:
> This variable is only used inside the file, and we should
> never hard-code the GPIO base, so delete this.

Adding the Cirrus people again...  hard coding the GPIO base is needed
for board file based systems if they're using GPIO numbers isn't it?

> 
> 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
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180918/985de290/attachment-0001.sig>


More information about the Alsa-devel mailing list