summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-11-04 03:56:26 -0500
committerLinus Walleij <linus.walleij@linaro.org>2015-11-19 03:24:35 -0500
commit58383c78425e4ee1c077253cf297b641c861c02e (patch)
tree606949d2c6db8176c0659eaa935d022bf6d19974 /sound
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
gpio: change member .dev to .parent
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 <hskinnemoen@gmail.com> Cc: Rafał Miłecki <zajec5@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Alek Du <alek.du@intel.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/rt5677.c2
-rw-r--r--sound/soc/codecs/wm5100.c2
-rw-r--r--sound/soc/codecs/wm8903.c2
-rw-r--r--sound/soc/codecs/wm8962.c2
-rw-r--r--sound/soc/codecs/wm8996.c2
5 files changed, 5 insertions, 5 deletions
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)
4674 4674
4675 rt5677->gpio_chip = rt5677_template_chip; 4675 rt5677->gpio_chip = rt5677_template_chip;
4676 rt5677->gpio_chip.ngpio = RT5677_GPIO_NUM; 4676 rt5677->gpio_chip.ngpio = RT5677_GPIO_NUM;
4677 rt5677->gpio_chip.dev = &i2c->dev; 4677 rt5677->gpio_chip.parent = &i2c->dev;
4678 rt5677->gpio_chip.base = -1; 4678 rt5677->gpio_chip.base = -1;
4679 4679
4680 ret = gpiochip_add(&rt5677->gpio_chip); 4680 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)
2306 2306
2307 wm5100->gpio_chip = wm5100_template_chip; 2307 wm5100->gpio_chip = wm5100_template_chip;
2308 wm5100->gpio_chip.ngpio = 6; 2308 wm5100->gpio_chip.ngpio = 6;
2309 wm5100->gpio_chip.dev = &i2c->dev; 2309 wm5100->gpio_chip.parent = &i2c->dev;
2310 2310
2311 if (wm5100->pdata.gpio_base) 2311 if (wm5100->pdata.gpio_base)
2312 wm5100->gpio_chip.base = wm5100->pdata.gpio_base; 2312 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)
1853 1853
1854 wm8903->gpio_chip = wm8903_template_chip; 1854 wm8903->gpio_chip = wm8903_template_chip;
1855 wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO; 1855 wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO;
1856 wm8903->gpio_chip.dev = wm8903->dev; 1856 wm8903->gpio_chip.parent = wm8903->dev;
1857 1857
1858 if (pdata->gpio_base) 1858 if (pdata->gpio_base)
1859 wm8903->gpio_chip.base = pdata->gpio_base; 1859 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)
3380 3380
3381 wm8962->gpio_chip = wm8962_template_chip; 3381 wm8962->gpio_chip = wm8962_template_chip;
3382 wm8962->gpio_chip.ngpio = WM8962_MAX_GPIO; 3382 wm8962->gpio_chip.ngpio = WM8962_MAX_GPIO;
3383 wm8962->gpio_chip.dev = codec->dev; 3383 wm8962->gpio_chip.parent = codec->dev;
3384 3384
3385 if (pdata->gpio_base) 3385 if (pdata->gpio_base)
3386 wm8962->gpio_chip.base = pdata->gpio_base; 3386 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)
2204 2204
2205 wm8996->gpio_chip = wm8996_template_chip; 2205 wm8996->gpio_chip = wm8996_template_chip;
2206 wm8996->gpio_chip.ngpio = 5; 2206 wm8996->gpio_chip.ngpio = 5;
2207 wm8996->gpio_chip.dev = wm8996->dev; 2207 wm8996->gpio_chip.parent = wm8996->dev;
2208 2208
2209 if (wm8996->pdata.gpio_base) 2209 if (wm8996->pdata.gpio_base)
2210 wm8996->gpio_chip.base = wm8996->pdata.gpio_base; 2210 wm8996->gpio_chip.base = wm8996->pdata.gpio_base;