diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-11-04 11:56:26 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-11-19 11:24:35 +0300 |
commit | 58383c78425e4ee1c077253cf297b641c861c02e (patch) | |
tree | 606949d2c6db8176c0659eaa935d022bf6d19974 /drivers/mfd | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
download | linux-58383c78425e4ee1c077253cf297b641c861c02e.tar.xz |
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 'drivers/mfd')
-rw-r--r-- | drivers/mfd/dm355evm_msp.c | 2 | ||||
-rw-r--r-- | drivers/mfd/htc-egpio.c | 2 | ||||
-rw-r--r-- | drivers/mfd/htc-i2cpld.c | 4 | ||||
-rw-r--r-- | drivers/mfd/tps65010.c | 2 | ||||
-rw-r--r-- | drivers/mfd/ucb1x00-core.c | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c index 4c826f78acd0..bc90efe01b59 100644 --- a/drivers/mfd/dm355evm_msp.c +++ b/drivers/mfd/dm355evm_msp.c @@ -259,7 +259,7 @@ static int add_children(struct i2c_client *client) int i; /* GPIO-ish stuff */ - dm355evm_msp_gpio.dev = &client->dev; + dm355evm_msp_gpio.parent = &client->dev; status = gpiochip_add(&dm355evm_msp_gpio); if (status < 0) return status; diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c index 6ccaf90d98fd..d334e7d8a77d 100644 --- a/drivers/mfd/htc-egpio.c +++ b/drivers/mfd/htc-egpio.c @@ -321,7 +321,7 @@ static int __init egpio_probe(struct platform_device *pdev) ei->chip[i].dev = &(pdev->dev); chip = &(ei->chip[i].chip); chip->label = "htc-egpio"; - chip->dev = &pdev->dev; + chip->parent = &pdev->dev; chip->owner = THIS_MODULE; chip->get = egpio_get; chip->set = egpio_set; diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index 0c6ff727b2ec..bd6b96d07ab8 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c @@ -429,7 +429,7 @@ static int htcpld_register_chip_gpio( /* Setup the GPIO chips */ gpio_chip = &(chip->chip_out); gpio_chip->label = "htcpld-out"; - gpio_chip->dev = dev; + gpio_chip->parent = dev; gpio_chip->owner = THIS_MODULE; gpio_chip->get = htcpld_chip_get; gpio_chip->set = htcpld_chip_set; @@ -440,7 +440,7 @@ static int htcpld_register_chip_gpio( gpio_chip = &(chip->chip_in); gpio_chip->label = "htcpld-in"; - gpio_chip->dev = dev; + gpio_chip->parent = dev; gpio_chip->owner = THIS_MODULE; gpio_chip->get = htcpld_chip_get; gpio_chip->set = NULL; diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 448f0a182dc4..b96847491277 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c @@ -638,7 +638,7 @@ static int tps65010_probe(struct i2c_client *client, tps->outmask = board->outmask; tps->chip.label = client->name; - tps->chip.dev = &client->dev; + tps->chip.parent = &client->dev; tps->chip.owner = THIS_MODULE; tps->chip.set = tps65010_gpio_set; diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index f691d7ecad52..a6ec7cc0fac6 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c @@ -570,7 +570,7 @@ static int ucb1x00_probe(struct mcp *mcp) if (pdata && pdata->gpio_base) { ucb->gpio.label = dev_name(&ucb->dev); - ucb->gpio.dev = &ucb->dev; + ucb->gpio.parent = &ucb->dev; ucb->gpio.owner = THIS_MODULE; ucb->gpio.base = pdata->gpio_base; ucb->gpio.ngpio = 10; |