From 58383c78425e4ee1c077253cf297b641c861c02e Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Wed, 4 Nov 2015 09:56:26 +0100 Subject: gpio: change member .dev to .parent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The name .dev in a struct is normally reserved for a struct device that is let us say a superclass to the thing described by the struct. struct gpio_chip stands out by confusingly using a struct device *dev to point to the parent device (such as a platform_device) that represents the hardware. As we want to give gpio_chip:s real devices, this is not working. We need to rename this member to parent. This was done by two coccinelle scripts, I guess it is possible to combine them into one, but I don't know such stuff. They look like this: @@ struct gpio_chip *var; @@ -var->dev +var->parent and: @@ struct gpio_chip var; @@ -var.dev +var.parent and: @@ struct bgpio_chip *var; @@ -var->gc.dev +var->gc.parent Plus a few instances of bgpio that I couldn't figure out how to teach Coccinelle to rewrite. This patch hits all over the place, but I *strongly* prefer this solution to any piecemal approaches that just exercise patch mechanics all over the place. It mainly hits drivers/gpio and drivers/pinctrl which is my own backyard anyway. Cc: Haavard Skinnemoen Cc: Rafał Miłecki Cc: Richard Purdie Cc: Mauro Carvalho Chehab Cc: Alek Du Cc: Jaroslav Kysela Cc: Takashi Iwai Acked-by: Dmitry Torokhov Acked-by: Greg Kroah-Hartman Acked-by: Lee Jones Acked-by: Jiri Kosina Acked-by: Hans-Christian Egtvedt Acked-by: Jacek Anaszewski Signed-off-by: Linus Walleij --- sound/soc/codecs/rt5677.c | 2 +- sound/soc/codecs/wm5100.c | 2 +- sound/soc/codecs/wm8903.c | 2 +- sound/soc/codecs/wm8962.c | 2 +- sound/soc/codecs/wm8996.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index b4cd7e3bf5f8..1f590b5a6718 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -4674,7 +4674,7 @@ static void rt5677_init_gpio(struct i2c_client *i2c) rt5677->gpio_chip = rt5677_template_chip; rt5677->gpio_chip.ngpio = RT5677_GPIO_NUM; - rt5677->gpio_chip.dev = &i2c->dev; + rt5677->gpio_chip.parent = &i2c->dev; rt5677->gpio_chip.base = -1; ret = gpiochip_add(&rt5677->gpio_chip); diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index c2cdcae18ff6..171a23ddd15d 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c @@ -2306,7 +2306,7 @@ static void wm5100_init_gpio(struct i2c_client *i2c) wm5100->gpio_chip = wm5100_template_chip; wm5100->gpio_chip.ngpio = 6; - wm5100->gpio_chip.dev = &i2c->dev; + wm5100->gpio_chip.parent = &i2c->dev; if (wm5100->pdata.gpio_base) wm5100->gpio_chip.base = wm5100->pdata.gpio_base; diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index e4cc41e6c23e..2512def0d349 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -1853,7 +1853,7 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903) wm8903->gpio_chip = wm8903_template_chip; wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; - wm8903->gpio_chip.dev = wm8903->dev; + wm8903->gpio_chip.parent = wm8903->dev; if (pdata->gpio_base) wm8903->gpio_chip.base = pdata->gpio_base; diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 39ebd7bf4f53..b563d6746ac4 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -3380,7 +3380,7 @@ static void wm8962_init_gpio(struct snd_soc_codec *codec) wm8962->gpio_chip = wm8962_template_chip; wm8962->gpio_chip.ngpio = WM8962_MAX_GPIO; - wm8962->gpio_chip.dev = codec->dev; + wm8962->gpio_chip.parent = codec->dev; if (pdata->gpio_base) wm8962->gpio_chip.base = pdata->gpio_base; diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index f7ccd9fc5808..8d7d6c01a2f7 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -2204,7 +2204,7 @@ static void wm8996_init_gpio(struct wm8996_priv *wm8996) wm8996->gpio_chip = wm8996_template_chip; wm8996->gpio_chip.ngpio = 5; - wm8996->gpio_chip.dev = wm8996->dev; + wm8996->gpio_chip.parent = wm8996->dev; if (wm8996->pdata.gpio_base) wm8996->gpio_chip.base = wm8996->pdata.gpio_base; -- cgit v1.2.3 From a1eb9d5751220433998ae2e66216288161b1355b Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 7 Dec 2015 13:32:28 +0100 Subject: ASoC: ac97: fix parent assignment Upstream GPIO has substituted .dev for .parent in struct gpio_chip. Signed-off-by: Linus Walleij --- sound/soc/soc-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/soc-ac97.c b/sound/soc/soc-ac97.c index ae563e379a72..a2012652f212 100644 --- a/sound/soc/soc-ac97.c +++ b/sound/soc/soc-ac97.c @@ -142,7 +142,7 @@ static int snd_soc_ac97_init_gpio(struct snd_ac97 *ac97, gpio_priv->codec = codec; gpio_priv->gpio_chip = snd_soc_ac97_gpio_chip; gpio_priv->gpio_chip.ngpio = AC97_NUM_GPIOS; - gpio_priv->gpio_chip.dev = codec->dev; + gpio_priv->gpio_chip.parent = codec->dev; gpio_priv->gpio_chip.base = -1; ret = gpiochip_add(&gpio_priv->gpio_chip); -- cgit v1.2.3