summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/avr32/mach-at32ap/pio.c2
-rw-r--r--drivers/bcma/driver_gpio.c2
-rw-r--r--drivers/gpio/gpio-104-idio-16.c2
-rw-r--r--drivers/gpio/gpio-74x164.c4
-rw-r--r--drivers/gpio/gpio-adnp.c19
-rw-r--r--drivers/gpio/gpio-altera.c2
-rw-r--r--drivers/gpio/gpio-amd8111.c2
-rw-r--r--drivers/gpio/gpio-amdpt.c18
-rw-r--r--drivers/gpio/gpio-arizona.c2
-rw-r--r--drivers/gpio/gpio-ath79.c2
-rw-r--r--drivers/gpio/gpio-bcm-kona.c6
-rw-r--r--drivers/gpio/gpio-crystalcove.c2
-rw-r--r--drivers/gpio/gpio-davinci.c4
-rw-r--r--drivers/gpio/gpio-dln2.c10
-rw-r--r--drivers/gpio/gpio-em.c4
-rw-r--r--drivers/gpio/gpio-f7188x.c2
-rw-r--r--drivers/gpio/gpio-generic.c2
-rw-r--r--drivers/gpio/gpio-ich.c2
-rw-r--r--drivers/gpio/gpio-intel-mid.c2
-rw-r--r--drivers/gpio/gpio-janz-ttl.c6
-rw-r--r--drivers/gpio/gpio-kempld.c2
-rw-r--r--drivers/gpio/gpio-lp3943.c2
-rw-r--r--drivers/gpio/gpio-lpc18xx.c2
-rw-r--r--drivers/gpio/gpio-lynxpoint.c2
-rw-r--r--drivers/gpio/gpio-max730x.c2
-rw-r--r--drivers/gpio/gpio-max732x.c4
-rw-r--r--drivers/gpio/gpio-mb86s7x.c2
-rw-r--r--drivers/gpio/gpio-mc33880.c2
-rw-r--r--drivers/gpio/gpio-mc9s08dz60.c2
-rw-r--r--drivers/gpio/gpio-mcp23s08.c16
-rw-r--r--drivers/gpio/gpio-moxart.c2
-rw-r--r--drivers/gpio/gpio-msic.c2
-rw-r--r--drivers/gpio/gpio-mvebu.c2
-rw-r--r--drivers/gpio/gpio-octeon.c2
-rw-r--r--drivers/gpio/gpio-omap.c4
-rw-r--r--drivers/gpio/gpio-palmas.c14
-rw-r--r--drivers/gpio/gpio-pca953x.c2
-rw-r--r--drivers/gpio/gpio-pcf857x.c2
-rw-r--r--drivers/gpio/gpio-pch.c2
-rw-r--r--drivers/gpio/gpio-pl061.c12
-rw-r--r--drivers/gpio/gpio-rc5t583.c2
-rw-r--r--drivers/gpio/gpio-rcar.c2
-rw-r--r--drivers/gpio/gpio-sch.c2
-rw-r--r--drivers/gpio/gpio-sch311x.c4
-rw-r--r--drivers/gpio/gpio-spear-spics.c2
-rw-r--r--drivers/gpio/gpio-stmpe.c2
-rw-r--r--drivers/gpio/gpio-stp-xway.c4
-rw-r--r--drivers/gpio/gpio-sx150x.c2
-rw-r--r--drivers/gpio/gpio-syscon.c4
-rw-r--r--drivers/gpio/gpio-tb10x.c2
-rw-r--r--drivers/gpio/gpio-tc3589x.c2
-rw-r--r--drivers/gpio/gpio-timberdale.c2
-rw-r--r--drivers/gpio/gpio-tps6586x.c2
-rw-r--r--drivers/gpio/gpio-tps65910.c2
-rw-r--r--drivers/gpio/gpio-tps65912.c2
-rw-r--r--drivers/gpio/gpio-ts5500.c5
-rw-r--r--drivers/gpio/gpio-twl4030.c4
-rw-r--r--drivers/gpio/gpio-twl6040.c6
-rw-r--r--drivers/gpio/gpio-tz1090-pdc.c2
-rw-r--r--drivers/gpio/gpio-tz1090.c2
-rw-r--r--drivers/gpio/gpio-vf610.c2
-rw-r--r--drivers/gpio/gpio-viperboard.c16
-rw-r--r--drivers/gpio/gpio-vr41xx.c4
-rw-r--r--drivers/gpio/gpio-wm831x.c2
-rw-r--r--drivers/gpio/gpio-wm8350.c2
-rw-r--r--drivers/gpio/gpio-wm8994.c2
-rw-r--r--drivers/gpio/gpio-xgene.c2
-rw-r--r--drivers/gpio/gpio-xilinx.c2
-rw-r--r--drivers/gpio/gpio-xlp.c2
-rw-r--r--drivers/gpio/gpio-zevio.c4
-rw-r--r--drivers/gpio/gpio-zx.c2
-rw-r--r--drivers/gpio/gpio-zynq.c6
-rw-r--r--drivers/gpio/gpiolib-acpi.c47
-rw-r--r--drivers/gpio/gpiolib-of.c4
-rw-r--r--drivers/gpio/gpiolib-sysfs.c5
-rw-r--r--drivers/gpio/gpiolib.c19
-rw-r--r--drivers/hid/hid-cp2112.c2
-rw-r--r--drivers/input/touchscreen/ad7879.c2
-rw-r--r--drivers/leds/leds-pca9532.c6
-rw-r--r--drivers/leds/leds-tca6507.c2
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_core.c2
-rw-r--r--drivers/mfd/dm355evm_msp.c2
-rw-r--r--drivers/mfd/htc-egpio.c2
-rw-r--r--drivers/mfd/htc-i2cpld.c4
-rw-r--r--drivers/mfd/tps65010.c2
-rw-r--r--drivers/mfd/ucb1x00-core.c2
-rw-r--r--drivers/pinctrl/bcm/pinctrl-bcm2835.c8
-rw-r--r--drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c2
-rw-r--r--drivers/pinctrl/intel/pinctrl-baytrail.c2
-rw-r--r--drivers/pinctrl/intel/pinctrl-cherryview.c2
-rw-r--r--drivers/pinctrl/intel/pinctrl-intel.c2
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.c12
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson.c2
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-abx500.c7
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-nomadik.c8
-rw-r--r--drivers/pinctrl/pinctrl-amd.c2
-rw-r--r--drivers/pinctrl/pinctrl-as3722.c2
-rw-r--r--drivers/pinctrl/pinctrl-at91-pio4.c12
-rw-r--r--drivers/pinctrl/pinctrl-at91.c2
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c2
-rw-r--r--drivers/pinctrl/pinctrl-digicolor.c2
-rw-r--r--drivers/pinctrl/pinctrl-pistachio.c2
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c2
-rw-r--r--drivers/pinctrl/pinctrl-st.c2
-rw-r--r--drivers/pinctrl/pinctrl-xway.c10
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c2
-rw-r--r--drivers/pinctrl/qcom/pinctrl-spmi-gpio.c2
-rw-r--r--drivers/pinctrl/qcom/pinctrl-spmi-mpp.c2
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c2
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c2
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos.c3
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos5440.c12
-rw-r--r--drivers/pinctrl/samsung/pinctrl-samsung.c2
-rw-r--r--drivers/pinctrl/sh-pfc/gpio.c2
-rw-r--r--drivers/pinctrl/sirf/pinctrl-atlas7.c2
-rw-r--r--drivers/pinctrl/sirf/pinctrl-sirf.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-plgpio.c2
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sunxi.c10
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c8
-rw-r--r--drivers/platform/x86/intel_pmic_gpio.c4
-rw-r--r--drivers/tty/serial/max310x.c2
-rw-r--r--drivers/tty/serial/sc16is7xx.c2
-rw-r--r--include/linux/gpio/driver.h4
-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
128 files changed, 274 insertions, 261 deletions
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index 4f61378c3453..aa74491771fa 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -397,7 +397,7 @@ static int __init pio_probe(struct platform_device *pdev)
397 pio->chip.label = pio->name; 397 pio->chip.label = pio->name;
398 pio->chip.base = pdev->id * 32; 398 pio->chip.base = pdev->id * 32;
399 pio->chip.ngpio = 32; 399 pio->chip.ngpio = 32;
400 pio->chip.dev = &pdev->dev; 400 pio->chip.parent = &pdev->dev;
401 pio->chip.owner = THIS_MODULE; 401 pio->chip.owner = THIS_MODULE;
402 402
403 pio->chip.direction_input = direction_input; 403 pio->chip.direction_input = direction_input;
diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c
index 504899a72966..949754427ce2 100644
--- a/drivers/bcma/driver_gpio.c
+++ b/drivers/bcma/driver_gpio.c
@@ -188,7 +188,7 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
188 chip->direction_input = bcma_gpio_direction_input; 188 chip->direction_input = bcma_gpio_direction_input;
189 chip->direction_output = bcma_gpio_direction_output; 189 chip->direction_output = bcma_gpio_direction_output;
190 chip->owner = THIS_MODULE; 190 chip->owner = THIS_MODULE;
191 chip->dev = bcma_bus_get_host_dev(bus); 191 chip->parent = bcma_bus_get_host_dev(bus);
192#if IS_BUILTIN(CONFIG_OF) 192#if IS_BUILTIN(CONFIG_OF)
193 if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC) 193 if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
194 chip->of_node = cc->core->dev.of_node; 194 chip->of_node = cc->core->dev.of_node;
diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-16.c
index 5400d7d4d8fd..107cfd7105a8 100644
--- a/drivers/gpio/gpio-104-idio-16.c
+++ b/drivers/gpio/gpio-104-idio-16.c
@@ -127,7 +127,7 @@ static int __init idio_16_probe(struct platform_device *pdev)
127 } 127 }
128 128
129 idio16gpio->chip.label = NAME; 129 idio16gpio->chip.label = NAME;
130 idio16gpio->chip.dev = dev; 130 idio16gpio->chip.parent = dev;
131 idio16gpio->chip.owner = THIS_MODULE; 131 idio16gpio->chip.owner = THIS_MODULE;
132 idio16gpio->chip.base = -1; 132 idio16gpio->chip.base = -1;
133 idio16gpio->chip.ngpio = 32; 133 idio16gpio->chip.ngpio = 32;
diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index 60172f835d15..fb555300008f 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -33,7 +33,7 @@ static struct gen_74x164_chip *gpio_to_74x164_chip(struct gpio_chip *gc)
33 33
34static int __gen_74x164_write_config(struct gen_74x164_chip *chip) 34static int __gen_74x164_write_config(struct gen_74x164_chip *chip)
35{ 35{
36 struct spi_device *spi = to_spi_device(chip->gpio_chip.dev); 36 struct spi_device *spi = to_spi_device(chip->gpio_chip.parent);
37 struct spi_message message; 37 struct spi_message message;
38 struct spi_transfer *msg_buf; 38 struct spi_transfer *msg_buf;
39 int i, ret = 0; 39 int i, ret = 0;
@@ -143,7 +143,7 @@ static int gen_74x164_probe(struct spi_device *spi)
143 return -ENOMEM; 143 return -ENOMEM;
144 144
145 chip->gpio_chip.can_sleep = true; 145 chip->gpio_chip.can_sleep = true;
146 chip->gpio_chip.dev = &spi->dev; 146 chip->gpio_chip.parent = &spi->dev;
147 chip->gpio_chip.owner = THIS_MODULE; 147 chip->gpio_chip.owner = THIS_MODULE;
148 148
149 mutex_init(&chip->lock); 149 mutex_init(&chip->lock);
diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index d3d0a90fe542..b34a62a5a7e1 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -47,7 +47,7 @@ static int adnp_read(struct adnp *adnp, unsigned offset, uint8_t *value)
47 47
48 err = i2c_smbus_read_byte_data(adnp->client, offset); 48 err = i2c_smbus_read_byte_data(adnp->client, offset);
49 if (err < 0) { 49 if (err < 0) {
50 dev_err(adnp->gpio.dev, "%s failed: %d\n", 50 dev_err(adnp->gpio.parent, "%s failed: %d\n",
51 "i2c_smbus_read_byte_data()", err); 51 "i2c_smbus_read_byte_data()", err);
52 return err; 52 return err;
53 } 53 }
@@ -62,7 +62,7 @@ static int adnp_write(struct adnp *adnp, unsigned offset, uint8_t value)
62 62
63 err = i2c_smbus_write_byte_data(adnp->client, offset, value); 63 err = i2c_smbus_write_byte_data(adnp->client, offset, value);
64 if (err < 0) { 64 if (err < 0) {
65 dev_err(adnp->gpio.dev, "%s failed: %d\n", 65 dev_err(adnp->gpio.parent, "%s failed: %d\n",
66 "i2c_smbus_write_byte_data()", err); 66 "i2c_smbus_write_byte_data()", err);
67 return err; 67 return err;
68 } 68 }
@@ -266,8 +266,8 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios)
266 chip->base = -1; 266 chip->base = -1;
267 chip->ngpio = num_gpios; 267 chip->ngpio = num_gpios;
268 chip->label = adnp->client->name; 268 chip->label = adnp->client->name;
269 chip->dev = &adnp->client->dev; 269 chip->parent = &adnp->client->dev;
270 chip->of_node = chip->dev->of_node; 270 chip->of_node = chip->parent->of_node;
271 chip->owner = THIS_MODULE; 271 chip->owner = THIS_MODULE;
272 272
273 err = gpiochip_add(chip); 273 err = gpiochip_add(chip);
@@ -435,7 +435,8 @@ static int adnp_irq_setup(struct adnp *adnp)
435 * is chosen to match the register layout of the hardware in that 435 * is chosen to match the register layout of the hardware in that
436 * each segment contains the corresponding bits for all interrupts. 436 * each segment contains the corresponding bits for all interrupts.
437 */ 437 */
438 adnp->irq_enable = devm_kzalloc(chip->dev, num_regs * 6, GFP_KERNEL); 438 adnp->irq_enable = devm_kzalloc(chip->parent, num_regs * 6,
439 GFP_KERNEL);
439 if (!adnp->irq_enable) 440 if (!adnp->irq_enable)
440 return -ENOMEM; 441 return -ENOMEM;
441 442
@@ -462,12 +463,12 @@ static int adnp_irq_setup(struct adnp *adnp)
462 adnp->irq_enable[i] = 0x00; 463 adnp->irq_enable[i] = 0x00;
463 } 464 }
464 465
465 err = devm_request_threaded_irq(chip->dev, adnp->client->irq, 466 err = devm_request_threaded_irq(chip->parent, adnp->client->irq,
466 NULL, adnp_irq, 467 NULL, adnp_irq,
467 IRQF_TRIGGER_RISING | IRQF_ONESHOT, 468 IRQF_TRIGGER_RISING | IRQF_ONESHOT,
468 dev_name(chip->dev), adnp); 469 dev_name(chip->parent), adnp);
469 if (err != 0) { 470 if (err != 0) {
470 dev_err(chip->dev, "can't request IRQ#%d: %d\n", 471 dev_err(chip->parent, "can't request IRQ#%d: %d\n",
471 adnp->client->irq, err); 472 adnp->client->irq, err);
472 return err; 473 return err;
473 } 474 }
@@ -478,7 +479,7 @@ static int adnp_irq_setup(struct adnp *adnp)
478 handle_simple_irq, 479 handle_simple_irq,
479 IRQ_TYPE_NONE); 480 IRQ_TYPE_NONE);
480 if (err) { 481 if (err) {
481 dev_err(chip->dev, 482 dev_err(chip->parent,
482 "could not connect irqchip to gpiochip\n"); 483 "could not connect irqchip to gpiochip\n");
483 return err; 484 return err;
484 } 485 }
diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index 3e6661bab54a..84a20af01a9a 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -290,7 +290,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
290 altera_gc->mmchip.gc.get = altera_gpio_get; 290 altera_gc->mmchip.gc.get = altera_gpio_get;
291 altera_gc->mmchip.gc.set = altera_gpio_set; 291 altera_gc->mmchip.gc.set = altera_gpio_set;
292 altera_gc->mmchip.gc.owner = THIS_MODULE; 292 altera_gc->mmchip.gc.owner = THIS_MODULE;
293 altera_gc->mmchip.gc.dev = &pdev->dev; 293 altera_gc->mmchip.gc.parent = &pdev->dev;
294 294
295 ret = of_mm_gpiochip_add(node, &altera_gc->mmchip); 295 ret = of_mm_gpiochip_add(node, &altera_gc->mmchip);
296 if (ret) { 296 if (ret) {
diff --git a/drivers/gpio/gpio-amd8111.c b/drivers/gpio/gpio-amd8111.c
index d00d81928fe8..5c378e9f53a0 100644
--- a/drivers/gpio/gpio-amd8111.c
+++ b/drivers/gpio/gpio-amd8111.c
@@ -220,7 +220,7 @@ found:
220 goto out; 220 goto out;
221 } 221 }
222 gp.pdev = pdev; 222 gp.pdev = pdev;
223 gp.chip.dev = &pdev->dev; 223 gp.chip.parent = &pdev->dev;
224 224
225 spin_lock_init(&gp.lock); 225 spin_lock_init(&gp.lock);
226 226
diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index cbbb966d4fc0..f842ccc45e64 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -39,14 +39,14 @@ static int pt_gpio_request(struct gpio_chip *gc, unsigned offset)
39 unsigned long flags; 39 unsigned long flags;
40 u32 using_pins; 40 u32 using_pins;
41 41
42 dev_dbg(gc->dev, "pt_gpio_request offset=%x\n", offset); 42 dev_dbg(gc->parent, "pt_gpio_request offset=%x\n", offset);
43 43
44 spin_lock_irqsave(&pt_gpio->lock, flags); 44 spin_lock_irqsave(&pt_gpio->lock, flags);
45 45
46 using_pins = readl(pt_gpio->reg_base + PT_SYNC_REG); 46 using_pins = readl(pt_gpio->reg_base + PT_SYNC_REG);
47 if (using_pins & BIT(offset)) { 47 if (using_pins & BIT(offset)) {
48 dev_warn(gc->dev, "PT GPIO pin %x reconfigured\n", 48 dev_warn(gc->parent, "PT GPIO pin %x reconfigured\n",
49 offset); 49 offset);
50 spin_unlock_irqrestore(&pt_gpio->lock, flags); 50 spin_unlock_irqrestore(&pt_gpio->lock, flags);
51 return -EINVAL; 51 return -EINVAL;
52 } 52 }
@@ -72,7 +72,7 @@ static void pt_gpio_free(struct gpio_chip *gc, unsigned offset)
72 72
73 spin_unlock_irqrestore(&pt_gpio->lock, flags); 73 spin_unlock_irqrestore(&pt_gpio->lock, flags);
74 74
75 dev_dbg(gc->dev, "pt_gpio_free offset=%x\n", offset); 75 dev_dbg(gc->parent, "pt_gpio_free offset=%x\n", offset);
76} 76}
77 77
78static void pt_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value) 78static void pt_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
@@ -81,7 +81,7 @@ static void pt_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
81 unsigned long flags; 81 unsigned long flags;
82 u32 data; 82 u32 data;
83 83
84 dev_dbg(gc->dev, "pt_gpio_set_value offset=%x, value=%x\n", 84 dev_dbg(gc->parent, "pt_gpio_set_value offset=%x, value=%x\n",
85 offset, value); 85 offset, value);
86 86
87 spin_lock_irqsave(&pt_gpio->lock, flags); 87 spin_lock_irqsave(&pt_gpio->lock, flags);
@@ -116,7 +116,7 @@ static int pt_gpio_get_value(struct gpio_chip *gc, unsigned offset)
116 data >>= offset; 116 data >>= offset;
117 data &= 1; 117 data &= 1;
118 118
119 dev_dbg(gc->dev, "pt_gpio_get_value offset=%x, value=%x\n", 119 dev_dbg(gc->parent, "pt_gpio_get_value offset=%x, value=%x\n",
120 offset, data); 120 offset, data);
121 121
122 return data; 122 return data;
@@ -128,7 +128,7 @@ static int pt_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
128 unsigned long flags; 128 unsigned long flags;
129 u32 data; 129 u32 data;
130 130
131 dev_dbg(gc->dev, "pt_gpio_dirction_input offset=%x\n", offset); 131 dev_dbg(gc->parent, "pt_gpio_dirction_input offset=%x\n", offset);
132 132
133 spin_lock_irqsave(&pt_gpio->lock, flags); 133 spin_lock_irqsave(&pt_gpio->lock, flags);
134 134
@@ -148,7 +148,7 @@ static int pt_gpio_direction_output(struct gpio_chip *gc,
148 unsigned long flags; 148 unsigned long flags;
149 u32 data; 149 u32 data;
150 150
151 dev_dbg(gc->dev, "pt_gpio_direction_output offset=%x, value=%x\n", 151 dev_dbg(gc->parent, "pt_gpio_direction_output offset=%x, value=%x\n",
152 offset, value); 152 offset, value);
153 153
154 spin_lock_irqsave(&pt_gpio->lock, flags); 154 spin_lock_irqsave(&pt_gpio->lock, flags);
@@ -202,7 +202,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
202 202
203 pt_gpio->gc.label = pdev->name; 203 pt_gpio->gc.label = pdev->name;
204 pt_gpio->gc.owner = THIS_MODULE; 204 pt_gpio->gc.owner = THIS_MODULE;
205 pt_gpio->gc.dev = dev; 205 pt_gpio->gc.parent = dev;
206 pt_gpio->gc.request = pt_gpio_request; 206 pt_gpio->gc.request = pt_gpio_request;
207 pt_gpio->gc.free = pt_gpio_free; 207 pt_gpio->gc.free = pt_gpio_free;
208 pt_gpio->gc.direction_input = pt_gpio_direction_input; 208 pt_gpio->gc.direction_input = pt_gpio_direction_input;
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index ca002739616a..412d131b513d 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -108,7 +108,7 @@ static int arizona_gpio_probe(struct platform_device *pdev)
108 108
109 arizona_gpio->arizona = arizona; 109 arizona_gpio->arizona = arizona;
110 arizona_gpio->gpio_chip = template_chip; 110 arizona_gpio->gpio_chip = template_chip;
111 arizona_gpio->gpio_chip.dev = &pdev->dev; 111 arizona_gpio->gpio_chip.parent = &pdev->dev;
112#ifdef CONFIG_OF_GPIO 112#ifdef CONFIG_OF_GPIO
113 arizona_gpio->gpio_chip.of_node = arizona->dev->of_node; 113 arizona_gpio->gpio_chip.of_node = arizona->dev->of_node;
114#endif 114#endif
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index e5827a56ff3b..b1410226dc95 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -177,7 +177,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
177 177
178 spin_lock_init(&ctrl->lock); 178 spin_lock_init(&ctrl->lock);
179 memcpy(&ctrl->chip, &ath79_gpio_chip, sizeof(ctrl->chip)); 179 memcpy(&ctrl->chip, &ath79_gpio_chip, sizeof(ctrl->chip));
180 ctrl->chip.dev = &pdev->dev; 180 ctrl->chip.parent = &pdev->dev;
181 ctrl->chip.ngpio = ath79_gpio_count; 181 ctrl->chip.ngpio = ath79_gpio_count;
182 if (oe_inverted) { 182 if (oe_inverted) {
183 ctrl->chip.direction_input = ar934x_gpio_direction_input; 183 ctrl->chip.direction_input = ar934x_gpio_direction_input;
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 33a1f9779b86..21c3280d66e1 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -273,7 +273,7 @@ static int bcm_kona_gpio_set_debounce(struct gpio_chip *chip, unsigned gpio,
273 reg_base = kona_gpio->reg_base; 273 reg_base = kona_gpio->reg_base;
274 /* debounce must be 1-128ms (or 0) */ 274 /* debounce must be 1-128ms (or 0) */
275 if ((debounce > 0 && debounce < 1000) || debounce > 128000) { 275 if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
276 dev_err(chip->dev, "Debounce value %u not in range\n", 276 dev_err(chip->parent, "Debounce value %u not in range\n",
277 debounce); 277 debounce);
278 return -EINVAL; 278 return -EINVAL;
279 } 279 }
@@ -416,7 +416,7 @@ static int bcm_kona_gpio_irq_set_type(struct irq_data *d, unsigned int type)
416 case IRQ_TYPE_LEVEL_LOW: 416 case IRQ_TYPE_LEVEL_LOW:
417 /* BCM GPIO doesn't support level triggering */ 417 /* BCM GPIO doesn't support level triggering */
418 default: 418 default:
419 dev_err(kona_gpio->gpio_chip.dev, 419 dev_err(kona_gpio->gpio_chip.parent,
420 "Invalid BCM GPIO irq type 0x%x\n", type); 420 "Invalid BCM GPIO irq type 0x%x\n", type);
421 return -EINVAL; 421 return -EINVAL;
422 } 422 }
@@ -477,7 +477,7 @@ static int bcm_kona_gpio_irq_reqres(struct irq_data *d)
477 struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d); 477 struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d);
478 478
479 if (gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq)) { 479 if (gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq)) {
480 dev_err(kona_gpio->gpio_chip.dev, 480 dev_err(kona_gpio->gpio_chip.parent,
481 "unable to lock HW IRQ %lu for IRQ\n", 481 "unable to lock HW IRQ %lu for IRQ\n",
482 d->hwirq); 482 d->hwirq);
483 return -EINVAL; 483 return -EINVAL;
diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
index fddd204dc9b6..141093a8cd3f 100644
--- a/drivers/gpio/gpio-crystalcove.c
+++ b/drivers/gpio/gpio-crystalcove.c
@@ -341,7 +341,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
341 cg->chip.base = -1; 341 cg->chip.base = -1;
342 cg->chip.ngpio = CRYSTALCOVE_VGPIO_NUM; 342 cg->chip.ngpio = CRYSTALCOVE_VGPIO_NUM;
343 cg->chip.can_sleep = true; 343 cg->chip.can_sleep = true;
344 cg->chip.dev = dev; 344 cg->chip.parent = dev;
345 cg->chip.dbg_show = crystalcove_gpio_dbg_show; 345 cg->chip.dbg_show = crystalcove_gpio_dbg_show;
346 cg->regmap = pmic->regmap; 346 cg->regmap = pmic->regmap;
347 347
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 5e715388803d..cf31179726b1 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -179,8 +179,8 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc,
179 const struct of_phandle_args *gpiospec, 179 const struct of_phandle_args *gpiospec,
180 u32 *flags) 180 u32 *flags)
181{ 181{
182 struct davinci_gpio_controller *chips = dev_get_drvdata(gc->dev); 182 struct davinci_gpio_controller *chips = dev_get_drvdata(gc->parent);
183 struct davinci_gpio_platform_data *pdata = dev_get_platdata(gc->dev); 183 struct davinci_gpio_platform_data *pdata = dev_get_platdata(gc->parent);
184 184
185 if (gpiospec->args[0] > pdata->ngpio) 185 if (gpiospec->args[0] > pdata->ngpio)
186 return -EINVAL; 186 return -EINVAL;
diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c
index 6685712c15cf..e541af03dd45 100644
--- a/drivers/gpio/gpio-dln2.c
+++ b/drivers/gpio/gpio-dln2.c
@@ -377,7 +377,7 @@ static void dln2_irq_bus_unlock(struct irq_data *irqd)
377 377
378 ret = dln2_gpio_set_event_cfg(dln2, pin, type, 0); 378 ret = dln2_gpio_set_event_cfg(dln2, pin, type, 0);
379 if (ret) 379 if (ret)
380 dev_err(dln2->gpio.dev, "failed to set event\n"); 380 dev_err(dln2->gpio.parent, "failed to set event\n");
381 } 381 }
382 382
383 mutex_unlock(&dln2->irq_lock); 383 mutex_unlock(&dln2->irq_lock);
@@ -406,19 +406,19 @@ static void dln2_gpio_event(struct platform_device *pdev, u16 echo,
406 struct dln2_gpio *dln2 = platform_get_drvdata(pdev); 406 struct dln2_gpio *dln2 = platform_get_drvdata(pdev);
407 407
408 if (len < sizeof(*event)) { 408 if (len < sizeof(*event)) {
409 dev_err(dln2->gpio.dev, "short event message\n"); 409 dev_err(dln2->gpio.parent, "short event message\n");
410 return; 410 return;
411 } 411 }
412 412
413 pin = le16_to_cpu(event->pin); 413 pin = le16_to_cpu(event->pin);
414 if (pin >= dln2->gpio.ngpio) { 414 if (pin >= dln2->gpio.ngpio) {
415 dev_err(dln2->gpio.dev, "out of bounds pin %d\n", pin); 415 dev_err(dln2->gpio.parent, "out of bounds pin %d\n", pin);
416 return; 416 return;
417 } 417 }
418 418
419 irq = irq_find_mapping(dln2->gpio.irqdomain, pin); 419 irq = irq_find_mapping(dln2->gpio.irqdomain, pin);
420 if (!irq) { 420 if (!irq) {
421 dev_err(dln2->gpio.dev, "pin %d not mapped to IRQ\n", pin); 421 dev_err(dln2->gpio.parent, "pin %d not mapped to IRQ\n", pin);
422 return; 422 return;
423 } 423 }
424 424
@@ -462,7 +462,7 @@ static int dln2_gpio_probe(struct platform_device *pdev)
462 dln2->pdev = pdev; 462 dln2->pdev = pdev;
463 463
464 dln2->gpio.label = "dln2"; 464 dln2->gpio.label = "dln2";
465 dln2->gpio.dev = dev; 465 dln2->gpio.parent = dev;
466 dln2->gpio.owner = THIS_MODULE; 466 dln2->gpio.owner = THIS_MODULE;
467 dln2->gpio.base = -1; 467 dln2->gpio.base = -1;
468 dln2->gpio.ngpio = pins; 468 dln2->gpio.ngpio = pins;
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 6bca1e125e12..c3ca2b1c1dfe 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -103,7 +103,7 @@ static int em_gio_irq_reqres(struct irq_data *d)
103 struct em_gio_priv *p = irq_data_get_irq_chip_data(d); 103 struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
104 104
105 if (gpiochip_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d))) { 105 if (gpiochip_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d))) {
106 dev_err(p->gpio_chip.dev, 106 dev_err(p->gpio_chip.parent,
107 "unable to lock HW IRQ %lu for IRQ\n", 107 "unable to lock HW IRQ %lu for IRQ\n",
108 irqd_to_hwirq(d)); 108 irqd_to_hwirq(d));
109 return -EINVAL; 109 return -EINVAL;
@@ -332,7 +332,7 @@ static int em_gio_probe(struct platform_device *pdev)
332 gpio_chip->request = em_gio_request; 332 gpio_chip->request = em_gio_request;
333 gpio_chip->free = em_gio_free; 333 gpio_chip->free = em_gio_free;
334 gpio_chip->label = name; 334 gpio_chip->label = name;
335 gpio_chip->dev = &pdev->dev; 335 gpio_chip->parent = &pdev->dev;
336 gpio_chip->owner = THIS_MODULE; 336 gpio_chip->owner = THIS_MODULE;
337 gpio_chip->base = -1; 337 gpio_chip->base = -1;
338 gpio_chip->ngpio = ngpios; 338 gpio_chip->ngpio = ngpios;
diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
index 5e3c4fa67d82..1734e4fbd2b5 100644
--- a/drivers/gpio/gpio-f7188x.c
+++ b/drivers/gpio/gpio-f7188x.c
@@ -333,7 +333,7 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
333 for (i = 0; i < data->nr_bank; i++) { 333 for (i = 0; i < data->nr_bank; i++) {
334 struct f7188x_gpio_bank *bank = &data->bank[i]; 334 struct f7188x_gpio_bank *bank = &data->bank[i];
335 335
336 bank->chip.dev = &pdev->dev; 336 bank->chip.parent = &pdev->dev;
337 bank->data = data; 337 bank->data = data;
338 338
339 err = gpiochip_add(&bank->chip); 339 err = gpiochip_add(&bank->chip);
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index bd5193c67a9c..72088028d7a9 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -545,7 +545,7 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
545 return -EINVAL; 545 return -EINVAL;
546 546
547 spin_lock_init(&bgc->lock); 547 spin_lock_init(&bgc->lock);
548 bgc->gc.dev = dev; 548 bgc->gc.parent = dev;
549 bgc->gc.label = dev_name(dev); 549 bgc->gc.label = dev_name(dev);
550 bgc->gc.base = -1; 550 bgc->gc.base = -1;
551 bgc->gc.ngpio = bgc->bits; 551 bgc->gc.ngpio = bgc->bits;
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
index 4ba7ed502131..8623d12e23c1 100644
--- a/drivers/gpio/gpio-ich.c
+++ b/drivers/gpio/gpio-ich.c
@@ -282,7 +282,7 @@ static void ichx_gpiolib_setup(struct gpio_chip *chip)
282{ 282{
283 chip->owner = THIS_MODULE; 283 chip->owner = THIS_MODULE;
284 chip->label = DRV_NAME; 284 chip->label = DRV_NAME;
285 chip->dev = &ichx_priv.dev->dev; 285 chip->parent = &ichx_priv.dev->dev;
286 286
287 /* Allow chip-specific overrides of request()/get() */ 287 /* Allow chip-specific overrides of request()/get() */
288 chip->request = ichx_priv.desc->request ? 288 chip->request = ichx_priv.desc->request ?
diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c
index 70097472b02c..1c46a7ef2680 100644
--- a/drivers/gpio/gpio-intel-mid.c
+++ b/drivers/gpio/gpio-intel-mid.c
@@ -392,7 +392,7 @@ static int intel_gpio_probe(struct pci_dev *pdev,
392 392
393 priv->reg_base = pcim_iomap_table(pdev)[0]; 393 priv->reg_base = pcim_iomap_table(pdev)[0];
394 priv->chip.label = dev_name(&pdev->dev); 394 priv->chip.label = dev_name(&pdev->dev);
395 priv->chip.dev = &pdev->dev; 395 priv->chip.parent = &pdev->dev;
396 priv->chip.request = intel_gpio_request; 396 priv->chip.request = intel_gpio_request;
397 priv->chip.direction_input = intel_gpio_direction_input; 397 priv->chip.direction_input = intel_gpio_direction_input;
398 priv->chip.direction_output = intel_gpio_direction_output; 398 priv->chip.direction_output = intel_gpio_direction_output;
diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c
index 3a1664335f5e..e5f85cab0100 100644
--- a/drivers/gpio/gpio-janz-ttl.c
+++ b/drivers/gpio/gpio-janz-ttl.c
@@ -59,7 +59,7 @@ struct ttl_module {
59 59
60static int ttl_get_value(struct gpio_chip *gpio, unsigned offset) 60static int ttl_get_value(struct gpio_chip *gpio, unsigned offset)
61{ 61{
62 struct ttl_module *mod = dev_get_drvdata(gpio->dev); 62 struct ttl_module *mod = dev_get_drvdata(gpio->parent);
63 u8 *shadow; 63 u8 *shadow;
64 int ret; 64 int ret;
65 65
@@ -81,7 +81,7 @@ static int ttl_get_value(struct gpio_chip *gpio, unsigned offset)
81 81
82static void ttl_set_value(struct gpio_chip *gpio, unsigned offset, int value) 82static void ttl_set_value(struct gpio_chip *gpio, unsigned offset, int value)
83{ 83{
84 struct ttl_module *mod = dev_get_drvdata(gpio->dev); 84 struct ttl_module *mod = dev_get_drvdata(gpio->parent);
85 void __iomem *port; 85 void __iomem *port;
86 u8 *shadow; 86 u8 *shadow;
87 87
@@ -172,7 +172,7 @@ static int ttl_probe(struct platform_device *pdev)
172 172
173 /* Initialize the GPIO data structures */ 173 /* Initialize the GPIO data structures */
174 gpio = &mod->gpio; 174 gpio = &mod->gpio;
175 gpio->dev = &pdev->dev; 175 gpio->parent = &pdev->dev;
176 gpio->label = pdev->name; 176 gpio->label = pdev->name;
177 gpio->get = ttl_get_value; 177 gpio->get = ttl_get_value;
178 gpio->set = ttl_set_value; 178 gpio->set = ttl_set_value;
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index 83f281dda1e0..35dd1e0af364 100644
--- a/drivers/gpio/gpio-kempld.c
+++ b/drivers/gpio/gpio-kempld.c
@@ -166,7 +166,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
166 chip = &gpio->chip; 166 chip = &gpio->chip;
167 chip->label = "gpio-kempld"; 167 chip->label = "gpio-kempld";
168 chip->owner = THIS_MODULE; 168 chip->owner = THIS_MODULE;
169 chip->dev = dev; 169 chip->parent = dev;
170 chip->can_sleep = true; 170 chip->can_sleep = true;
171 if (pdata && pdata->gpio_base) 171 if (pdata && pdata->gpio_base)
172 chip->base = pdata->gpio_base; 172 chip->base = pdata->gpio_base;
diff --git a/drivers/gpio/gpio-lp3943.c b/drivers/gpio/gpio-lp3943.c
index cfc5b12b43ad..f979c3be217f 100644
--- a/drivers/gpio/gpio-lp3943.c
+++ b/drivers/gpio/gpio-lp3943.c
@@ -205,7 +205,7 @@ static int lp3943_gpio_probe(struct platform_device *pdev)
205 205
206 lp3943_gpio->lp3943 = lp3943; 206 lp3943_gpio->lp3943 = lp3943;
207 lp3943_gpio->chip = lp3943_gpio_chip; 207 lp3943_gpio->chip = lp3943_gpio_chip;
208 lp3943_gpio->chip.dev = &pdev->dev; 208 lp3943_gpio->chip.parent = &pdev->dev;
209 209
210 platform_set_drvdata(pdev, lp3943_gpio); 210 platform_set_drvdata(pdev, lp3943_gpio);
211 211
diff --git a/drivers/gpio/gpio-lpc18xx.c b/drivers/gpio/gpio-lpc18xx.c
index e39dcb0af8ae..b01fbc9db7cd 100644
--- a/drivers/gpio/gpio-lpc18xx.c
+++ b/drivers/gpio/gpio-lpc18xx.c
@@ -127,7 +127,7 @@ static int lpc18xx_gpio_probe(struct platform_device *pdev)
127 127
128 spin_lock_init(&gc->lock); 128 spin_lock_init(&gc->lock);
129 129
130 gc->gpio.dev = &pdev->dev; 130 gc->gpio.parent = &pdev->dev;
131 131
132 ret = gpiochip_add(&gc->gpio); 132 ret = gpiochip_add(&gc->gpio);
133 if (ret) { 133 if (ret) {
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c
index 127c37b380ae..6a48ffd6e0db 100644
--- a/drivers/gpio/gpio-lynxpoint.c
+++ b/drivers/gpio/gpio-lynxpoint.c
@@ -368,7 +368,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
368 gc->base = -1; 368 gc->base = -1;
369 gc->ngpio = LP_NUM_GPIO; 369 gc->ngpio = LP_NUM_GPIO;
370 gc->can_sleep = false; 370 gc->can_sleep = false;
371 gc->dev = dev; 371 gc->parent = dev;
372 372
373 ret = gpiochip_add(gc); 373 ret = gpiochip_add(gc);
374 if (ret) { 374 if (ret) {
diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c
index 0f57d2d248ec..5d6a723cb414 100644
--- a/drivers/gpio/gpio-max730x.c
+++ b/drivers/gpio/gpio-max730x.c
@@ -189,7 +189,7 @@ int __max730x_probe(struct max7301 *ts)
189 189
190 ts->chip.ngpio = PIN_NUMBER; 190 ts->chip.ngpio = PIN_NUMBER;
191 ts->chip.can_sleep = true; 191 ts->chip.can_sleep = true;
192 ts->chip.dev = dev; 192 ts->chip.parent = dev;
193 ts->chip.owner = THIS_MODULE; 193 ts->chip.owner = THIS_MODULE;
194 194
195 /* 195 /*
diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index 8c5252c6c327..c1e7b55644b0 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -603,7 +603,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip,
603 gc->base = gpio_start; 603 gc->base = gpio_start;
604 gc->ngpio = port; 604 gc->ngpio = port;
605 gc->label = chip->client->name; 605 gc->label = chip->client->name;
606 gc->dev = &chip->client->dev; 606 gc->parent = &chip->client->dev;
607 gc->owner = THIS_MODULE; 607 gc->owner = THIS_MODULE;
608 608
609 return port; 609 return port;
@@ -649,7 +649,7 @@ static int max732x_probe(struct i2c_client *client,
649 chip->client = client; 649 chip->client = client;
650 650
651 nr_port = max732x_setup_gpio(chip, id, pdata->gpio_base); 651 nr_port = max732x_setup_gpio(chip, id, pdata->gpio_base);
652 chip->gpio_chip.dev = &client->dev; 652 chip->gpio_chip.parent = &client->dev;
653 653
654 addr_a = (client->addr & 0x0f) | 0x60; 654 addr_a = (client->addr & 0x0f) | 0x60;
655 addr_b = (client->addr & 0x0f) | 0x50; 655 addr_b = (client->addr & 0x0f) | 0x50;
diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c
index ee93c0ab0a59..93d61a5be0d4 100644
--- a/drivers/gpio/gpio-mb86s7x.c
+++ b/drivers/gpio/gpio-mb86s7x.c
@@ -187,7 +187,7 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
187 gchip->gc.label = dev_name(&pdev->dev); 187 gchip->gc.label = dev_name(&pdev->dev);
188 gchip->gc.ngpio = 32; 188 gchip->gc.ngpio = 32;
189 gchip->gc.owner = THIS_MODULE; 189 gchip->gc.owner = THIS_MODULE;
190 gchip->gc.dev = &pdev->dev; 190 gchip->gc.parent = &pdev->dev;
191 gchip->gc.base = -1; 191 gchip->gc.base = -1;
192 192
193 platform_set_drvdata(pdev, gchip); 193 platform_set_drvdata(pdev, gchip);
diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c
index 2853731db5bc..b46b9e522e8c 100644
--- a/drivers/gpio/gpio-mc33880.c
+++ b/drivers/gpio/gpio-mc33880.c
@@ -116,7 +116,7 @@ static int mc33880_probe(struct spi_device *spi)
116 mc->chip.base = pdata->base; 116 mc->chip.base = pdata->base;
117 mc->chip.ngpio = PIN_NUMBER; 117 mc->chip.ngpio = PIN_NUMBER;
118 mc->chip.can_sleep = true; 118 mc->chip.can_sleep = true;
119 mc->chip.dev = &spi->dev; 119 mc->chip.parent = &spi->dev;
120 mc->chip.owner = THIS_MODULE; 120 mc->chip.owner = THIS_MODULE;
121 121
122 mc->port_config = 0x00; 122 mc->port_config = 0x00;
diff --git a/drivers/gpio/gpio-mc9s08dz60.c b/drivers/gpio/gpio-mc9s08dz60.c
index d62b4f8182bf..defa38f958fb 100644
--- a/drivers/gpio/gpio-mc9s08dz60.c
+++ b/drivers/gpio/gpio-mc9s08dz60.c
@@ -99,7 +99,7 @@ static int mc9s08dz60_probe(struct i2c_client *client,
99 99
100 mc9s->chip.label = client->name; 100 mc9s->chip.label = client->name;
101 mc9s->chip.base = -1; 101 mc9s->chip.base = -1;
102 mc9s->chip.dev = &client->dev; 102 mc9s->chip.parent = &client->dev;
103 mc9s->chip.owner = THIS_MODULE; 103 mc9s->chip.owner = THIS_MODULE;
104 mc9s->chip.ngpio = GPIO_NUM; 104 mc9s->chip.ngpio = GPIO_NUM;
105 mc9s->chip.can_sleep = true; 105 mc9s->chip.can_sleep = true;
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 4a41694919da..13cace0ca6f7 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -446,7 +446,7 @@ static int mcp23s08_irq_reqres(struct irq_data *data)
446 struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data); 446 struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
447 447
448 if (gpiochip_lock_as_irq(&mcp->chip, data->hwirq)) { 448 if (gpiochip_lock_as_irq(&mcp->chip, data->hwirq)) {
449 dev_err(mcp->chip.dev, 449 dev_err(mcp->chip.parent,
450 "unable to lock HW IRQ %lu for IRQ usage\n", 450 "unable to lock HW IRQ %lu for IRQ usage\n",
451 data->hwirq); 451 data->hwirq);
452 return -EINVAL; 452 return -EINVAL;
@@ -481,7 +481,8 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
481 481
482 mutex_init(&mcp->irq_lock); 482 mutex_init(&mcp->irq_lock);
483 483
484 mcp->irq_domain = irq_domain_add_linear(chip->dev->of_node, chip->ngpio, 484 mcp->irq_domain = irq_domain_add_linear(chip->parent->of_node,
485 chip->ngpio,
485 &irq_domain_simple_ops, mcp); 486 &irq_domain_simple_ops, mcp);
486 if (!mcp->irq_domain) 487 if (!mcp->irq_domain)
487 return -ENODEV; 488 return -ENODEV;
@@ -491,10 +492,11 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
491 else 492 else
492 irqflags |= IRQF_TRIGGER_LOW; 493 irqflags |= IRQF_TRIGGER_LOW;
493 494
494 err = devm_request_threaded_irq(chip->dev, mcp->irq, NULL, mcp23s08_irq, 495 err = devm_request_threaded_irq(chip->parent, mcp->irq, NULL,
495 irqflags, dev_name(chip->dev), mcp); 496 mcp23s08_irq,
497 irqflags, dev_name(chip->parent), mcp);
496 if (err != 0) { 498 if (err != 0) {
497 dev_err(chip->dev, "unable to request IRQ#%d: %d\n", 499 dev_err(chip->parent, "unable to request IRQ#%d: %d\n",
498 mcp->irq, err); 500 mcp->irq, err);
499 return err; 501 return err;
500 } 502 }
@@ -638,7 +640,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
638 640
639 mcp->chip.base = pdata->base; 641 mcp->chip.base = pdata->base;
640 mcp->chip.can_sleep = true; 642 mcp->chip.can_sleep = true;
641 mcp->chip.dev = dev; 643 mcp->chip.parent = dev;
642 mcp->chip.owner = THIS_MODULE; 644 mcp->chip.owner = THIS_MODULE;
643 645
644 /* verify MCP_IOCON.SEQOP = 0, so sequential reads work, 646 /* verify MCP_IOCON.SEQOP = 0, so sequential reads work,
@@ -652,7 +654,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
652 mcp->irq_controller = pdata->irq_controller; 654 mcp->irq_controller = pdata->irq_controller;
653 if (mcp->irq && mcp->irq_controller) { 655 if (mcp->irq && mcp->irq_controller) {
654 mcp->irq_active_high = 656 mcp->irq_active_high =
655 of_property_read_bool(mcp->chip.dev->of_node, 657 of_property_read_bool(mcp->chip.parent->of_node,
656 "microchip,irq-active-high"); 658 "microchip,irq-active-high");
657 659
658 if (type == MCP_TYPE_017) 660 if (type == MCP_TYPE_017)
diff --git a/drivers/gpio/gpio-moxart.c b/drivers/gpio/gpio-moxart.c
index d3355a6dc9b1..8942f4909a31 100644
--- a/drivers/gpio/gpio-moxart.c
+++ b/drivers/gpio/gpio-moxart.c
@@ -61,7 +61,7 @@ static int moxart_gpio_probe(struct platform_device *pdev)
61 bgc->data = bgc->read_reg(bgc->reg_set); 61 bgc->data = bgc->read_reg(bgc->reg_set);
62 bgc->gc.base = 0; 62 bgc->gc.base = 0;
63 bgc->gc.ngpio = 32; 63 bgc->gc.ngpio = 32;
64 bgc->gc.dev = dev; 64 bgc->gc.parent = dev;
65 bgc->gc.owner = THIS_MODULE; 65 bgc->gc.owner = THIS_MODULE;
66 66
67 ret = gpiochip_add(&bgc->gc); 67 ret = gpiochip_add(&bgc->gc);
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c
index 22523aae8abe..fe9ef2bc981a 100644
--- a/drivers/gpio/gpio-msic.c
+++ b/drivers/gpio/gpio-msic.c
@@ -293,7 +293,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
293 mg->chip.base = pdata->gpio_base; 293 mg->chip.base = pdata->gpio_base;
294 mg->chip.ngpio = MSIC_NUM_GPIO; 294 mg->chip.ngpio = MSIC_NUM_GPIO;
295 mg->chip.can_sleep = true; 295 mg->chip.can_sleep = true;
296 mg->chip.dev = dev; 296 mg->chip.parent = dev;
297 297
298 mutex_init(&mg->buslock); 298 mutex_init(&mg->buslock);
299 299
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index d428b97876c5..6acedf4e9b1c 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -698,7 +698,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
698 698
699 mvchip->soc_variant = soc_variant; 699 mvchip->soc_variant = soc_variant;
700 mvchip->chip.label = dev_name(&pdev->dev); 700 mvchip->chip.label = dev_name(&pdev->dev);
701 mvchip->chip.dev = &pdev->dev; 701 mvchip->chip.parent = &pdev->dev;
702 mvchip->chip.request = gpiochip_generic_request; 702 mvchip->chip.request = gpiochip_generic_request;
703 mvchip->chip.free = gpiochip_generic_free; 703 mvchip->chip.free = gpiochip_generic_free;
704 mvchip->chip.direction_input = mvebu_gpio_direction_input; 704 mvchip->chip.direction_input = mvebu_gpio_direction_input;
diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
index 62ae251d4490..3c66ce4fe9ed 100644
--- a/drivers/gpio/gpio-octeon.c
+++ b/drivers/gpio/gpio-octeon.c
@@ -108,7 +108,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
108 108
109 pdev->dev.platform_data = chip; 109 pdev->dev.platform_data = chip;
110 chip->label = "octeon-gpio"; 110 chip->label = "octeon-gpio";
111 chip->dev = &pdev->dev; 111 chip->parent = &pdev->dev;
112 chip->owner = THIS_MODULE; 112 chip->owner = THIS_MODULE;
113 chip->base = 0; 113 chip->base = 0;
114 chip->can_sleep = false; 114 chip->can_sleep = false;
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 56d2d026e62e..7e4f7c5f999a 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1090,7 +1090,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
1090 if (bank->is_mpuio) { 1090 if (bank->is_mpuio) {
1091 bank->chip.label = "mpuio"; 1091 bank->chip.label = "mpuio";
1092 if (bank->regs->wkup_en) 1092 if (bank->regs->wkup_en)
1093 bank->chip.dev = &omap_mpuio_device.dev; 1093 bank->chip.parent = &omap_mpuio_device.dev;
1094 bank->chip.base = OMAP_MPUIO(0); 1094 bank->chip.base = OMAP_MPUIO(0);
1095 } else { 1095 } else {
1096 bank->chip.label = "gpio"; 1096 bank->chip.label = "gpio";
@@ -1199,7 +1199,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
1199 } 1199 }
1200 1200
1201 bank->dev = dev; 1201 bank->dev = dev;
1202 bank->chip.dev = dev; 1202 bank->chip.parent = dev;
1203 bank->chip.owner = THIS_MODULE; 1203 bank->chip.owner = THIS_MODULE;
1204 bank->dbck_flag = pdata->dbck_flag; 1204 bank->dbck_flag = pdata->dbck_flag;
1205 bank->stride = pdata->bank_stride; 1205 bank->stride = pdata->bank_stride;
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index 171a6389f9ce..5f09ed1700dc 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -54,7 +54,7 @@ static int palmas_gpio_get(struct gpio_chip *gc, unsigned offset)
54 54
55 ret = palmas_read(palmas, PALMAS_GPIO_BASE, reg, &val); 55 ret = palmas_read(palmas, PALMAS_GPIO_BASE, reg, &val);
56 if (ret < 0) { 56 if (ret < 0) {
57 dev_err(gc->dev, "Reg 0x%02x read failed, %d\n", reg, ret); 57 dev_err(gc->parent, "Reg 0x%02x read failed, %d\n", reg, ret);
58 return ret; 58 return ret;
59 } 59 }
60 60
@@ -65,7 +65,7 @@ static int palmas_gpio_get(struct gpio_chip *gc, unsigned offset)
65 65
66 ret = palmas_read(palmas, PALMAS_GPIO_BASE, reg, &val); 66 ret = palmas_read(palmas, PALMAS_GPIO_BASE, reg, &val);
67 if (ret < 0) { 67 if (ret < 0) {
68 dev_err(gc->dev, "Reg 0x%02x read failed, %d\n", reg, ret); 68 dev_err(gc->parent, "Reg 0x%02x read failed, %d\n", reg, ret);
69 return ret; 69 return ret;
70 } 70 }
71 return !!(val & BIT(offset)); 71 return !!(val & BIT(offset));
@@ -90,7 +90,7 @@ static void palmas_gpio_set(struct gpio_chip *gc, unsigned offset,
90 90
91 ret = palmas_write(palmas, PALMAS_GPIO_BASE, reg, BIT(offset)); 91 ret = palmas_write(palmas, PALMAS_GPIO_BASE, reg, BIT(offset));
92 if (ret < 0) 92 if (ret < 0)
93 dev_err(gc->dev, "Reg 0x%02x write failed, %d\n", reg, ret); 93 dev_err(gc->parent, "Reg 0x%02x write failed, %d\n", reg, ret);
94} 94}
95 95
96static int palmas_gpio_output(struct gpio_chip *gc, unsigned offset, 96static int palmas_gpio_output(struct gpio_chip *gc, unsigned offset,
@@ -111,7 +111,8 @@ static int palmas_gpio_output(struct gpio_chip *gc, unsigned offset,
111 ret = palmas_update_bits(palmas, PALMAS_GPIO_BASE, reg, 111 ret = palmas_update_bits(palmas, PALMAS_GPIO_BASE, reg,
112 BIT(offset), BIT(offset)); 112 BIT(offset), BIT(offset));
113 if (ret < 0) 113 if (ret < 0)
114 dev_err(gc->dev, "Reg 0x%02x update failed, %d\n", reg, ret); 114 dev_err(gc->parent, "Reg 0x%02x update failed, %d\n", reg,
115 ret);
115 return ret; 116 return ret;
116} 117}
117 118
@@ -128,7 +129,8 @@ static int palmas_gpio_input(struct gpio_chip *gc, unsigned offset)
128 129
129 ret = palmas_update_bits(palmas, PALMAS_GPIO_BASE, reg, BIT(offset), 0); 130 ret = palmas_update_bits(palmas, PALMAS_GPIO_BASE, reg, BIT(offset), 0);
130 if (ret < 0) 131 if (ret < 0)
131 dev_err(gc->dev, "Reg 0x%02x update failed, %d\n", reg, ret); 132 dev_err(gc->parent, "Reg 0x%02x update failed, %d\n", reg,
133 ret);
132 return ret; 134 return ret;
133} 135}
134 136
@@ -186,7 +188,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
186 palmas_gpio->gpio_chip.to_irq = palmas_gpio_to_irq; 188 palmas_gpio->gpio_chip.to_irq = palmas_gpio_to_irq;
187 palmas_gpio->gpio_chip.set = palmas_gpio_set; 189 palmas_gpio->gpio_chip.set = palmas_gpio_set;
188 palmas_gpio->gpio_chip.get = palmas_gpio_get; 190 palmas_gpio->gpio_chip.get = palmas_gpio_get;
189 palmas_gpio->gpio_chip.dev = &pdev->dev; 191 palmas_gpio->gpio_chip.parent = &pdev->dev;
190#ifdef CONFIG_OF_GPIO 192#ifdef CONFIG_OF_GPIO
191 palmas_gpio->gpio_chip.of_node = pdev->dev.of_node; 193 palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
192#endif 194#endif
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 2d4892cc70fb..ddbbbe57eef8 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -367,7 +367,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
367 gc->base = chip->gpio_start; 367 gc->base = chip->gpio_start;
368 gc->ngpio = gpios; 368 gc->ngpio = gpios;
369 gc->label = chip->client->name; 369 gc->label = chip->client->name;
370 gc->dev = &chip->client->dev; 370 gc->parent = &chip->client->dev;
371 gc->owner = THIS_MODULE; 371 gc->owner = THIS_MODULE;
372 gc->names = chip->names; 372 gc->names = chip->names;
373} 373}
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index 1d4d9bc8b69d..c7552106a80c 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -293,7 +293,7 @@ static int pcf857x_probe(struct i2c_client *client,
293 293
294 gpio->chip.base = pdata ? pdata->gpio_base : -1; 294 gpio->chip.base = pdata ? pdata->gpio_base : -1;
295 gpio->chip.can_sleep = true; 295 gpio->chip.can_sleep = true;
296 gpio->chip.dev = &client->dev; 296 gpio->chip.parent = &client->dev;
297 gpio->chip.owner = THIS_MODULE; 297 gpio->chip.owner = THIS_MODULE;
298 gpio->chip.get = pcf857x_get; 298 gpio->chip.get = pcf857x_get;
299 gpio->chip.set = pcf857x_set; 299 gpio->chip.set = pcf857x_set;
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
index 34ed176df15a..e43db64e52b3 100644
--- a/drivers/gpio/gpio-pch.c
+++ b/drivers/gpio/gpio-pch.c
@@ -220,7 +220,7 @@ static void pch_gpio_setup(struct pch_gpio *chip)
220 struct gpio_chip *gpio = &chip->gpio; 220 struct gpio_chip *gpio = &chip->gpio;
221 221
222 gpio->label = dev_name(chip->dev); 222 gpio->label = dev_name(chip->dev);
223 gpio->dev = chip->dev; 223 gpio->parent = chip->dev;
224 gpio->owner = THIS_MODULE; 224 gpio->owner = THIS_MODULE;
225 gpio->direction_input = pch_gpio_direction_input; 225 gpio->direction_input = pch_gpio_direction_input;
226 gpio->get = pch_gpio_get; 226 gpio->get = pch_gpio_get;
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 4d4b37676702..e041639adc14 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -131,7 +131,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
131 if ((trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) && 131 if ((trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) &&
132 (trigger & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))) 132 (trigger & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)))
133 { 133 {
134 dev_err(gc->dev, 134 dev_err(gc->parent,
135 "trying to configure line %d for both level and edge " 135 "trying to configure line %d for both level and edge "
136 "detection, choose one!\n", 136 "detection, choose one!\n",
137 offset); 137 offset);
@@ -158,7 +158,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
158 else 158 else
159 gpioiev &= ~bit; 159 gpioiev &= ~bit;
160 irq_set_handler_locked(d, handle_level_irq); 160 irq_set_handler_locked(d, handle_level_irq);
161 dev_dbg(gc->dev, "line %d: IRQ on %s level\n", 161 dev_dbg(gc->parent, "line %d: IRQ on %s level\n",
162 offset, 162 offset,
163 polarity ? "HIGH" : "LOW"); 163 polarity ? "HIGH" : "LOW");
164 } else if ((trigger & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { 164 } else if ((trigger & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) {
@@ -167,7 +167,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
167 /* Select both edges, setting this makes GPIOEV be ignored */ 167 /* Select both edges, setting this makes GPIOEV be ignored */
168 gpioibe |= bit; 168 gpioibe |= bit;
169 irq_set_handler_locked(d, handle_edge_irq); 169 irq_set_handler_locked(d, handle_edge_irq);
170 dev_dbg(gc->dev, "line %d: IRQ on both edges\n", offset); 170 dev_dbg(gc->parent, "line %d: IRQ on both edges\n", offset);
171 } else if ((trigger & IRQ_TYPE_EDGE_RISING) || 171 } else if ((trigger & IRQ_TYPE_EDGE_RISING) ||
172 (trigger & IRQ_TYPE_EDGE_FALLING)) { 172 (trigger & IRQ_TYPE_EDGE_FALLING)) {
173 bool rising = trigger & IRQ_TYPE_EDGE_RISING; 173 bool rising = trigger & IRQ_TYPE_EDGE_RISING;
@@ -182,7 +182,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
182 else 182 else
183 gpioiev &= ~bit; 183 gpioiev &= ~bit;
184 irq_set_handler_locked(d, handle_edge_irq); 184 irq_set_handler_locked(d, handle_edge_irq);
185 dev_dbg(gc->dev, "line %d: IRQ on %s edge\n", 185 dev_dbg(gc->parent, "line %d: IRQ on %s edge\n",
186 offset, 186 offset,
187 rising ? "RISING" : "FALLING"); 187 rising ? "RISING" : "FALLING");
188 } else { 188 } else {
@@ -191,7 +191,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
191 gpioibe &= ~bit; 191 gpioibe &= ~bit;
192 gpioiev &= ~bit; 192 gpioiev &= ~bit;
193 irq_set_handler_locked(d, handle_bad_irq); 193 irq_set_handler_locked(d, handle_bad_irq);
194 dev_warn(gc->dev, "no trigger selected for line %d\n", 194 dev_warn(gc->parent, "no trigger selected for line %d\n",
195 offset); 195 offset);
196 } 196 }
197 197
@@ -316,7 +316,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
316 chip->gc.set = pl061_set_value; 316 chip->gc.set = pl061_set_value;
317 chip->gc.ngpio = PL061_GPIO_NR; 317 chip->gc.ngpio = PL061_GPIO_NR;
318 chip->gc.label = dev_name(dev); 318 chip->gc.label = dev_name(dev);
319 chip->gc.dev = dev; 319 chip->gc.parent = dev;
320 chip->gc.owner = THIS_MODULE; 320 chip->gc.owner = THIS_MODULE;
321 321
322 ret = gpiochip_add(&chip->gc); 322 ret = gpiochip_add(&chip->gc);
diff --git a/drivers/gpio/gpio-rc5t583.c b/drivers/gpio/gpio-rc5t583.c
index 6eabf239676b..f26d9f7d8cdd 100644
--- a/drivers/gpio/gpio-rc5t583.c
+++ b/drivers/gpio/gpio-rc5t583.c
@@ -132,7 +132,7 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
132 rc5t583_gpio->gpio_chip.to_irq = rc5t583_gpio_to_irq, 132 rc5t583_gpio->gpio_chip.to_irq = rc5t583_gpio_to_irq,
133 rc5t583_gpio->gpio_chip.ngpio = RC5T583_MAX_GPIO, 133 rc5t583_gpio->gpio_chip.ngpio = RC5T583_MAX_GPIO,
134 rc5t583_gpio->gpio_chip.can_sleep = true, 134 rc5t583_gpio->gpio_chip.can_sleep = true,
135 rc5t583_gpio->gpio_chip.dev = &pdev->dev; 135 rc5t583_gpio->gpio_chip.parent = &pdev->dev;
136 rc5t583_gpio->gpio_chip.base = -1; 136 rc5t583_gpio->gpio_chip.base = -1;
137 rc5t583_gpio->rc5t583 = rc5t583; 137 rc5t583_gpio->rc5t583 = rc5t583;
138 138
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
index 2a8122444614..3cbb25ecfc7a 100644
--- a/drivers/gpio/gpio-rcar.c
+++ b/drivers/gpio/gpio-rcar.c
@@ -449,7 +449,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
449 gpio_chip->direction_output = gpio_rcar_direction_output; 449 gpio_chip->direction_output = gpio_rcar_direction_output;
450 gpio_chip->set = gpio_rcar_set; 450 gpio_chip->set = gpio_rcar_set;
451 gpio_chip->label = name; 451 gpio_chip->label = name;
452 gpio_chip->dev = dev; 452 gpio_chip->parent = dev;
453 gpio_chip->owner = THIS_MODULE; 453 gpio_chip->owner = THIS_MODULE;
454 gpio_chip->base = p->config.gpio_base; 454 gpio_chip->base = p->config.gpio_base;
455 gpio_chip->ngpio = p->config.number_of_pins; 455 gpio_chip->ngpio = p->config.number_of_pins;
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
index b72906f5b999..a8a333ade9aa 100644
--- a/drivers/gpio/gpio-sch.c
+++ b/drivers/gpio/gpio-sch.c
@@ -171,7 +171,7 @@ static int sch_gpio_probe(struct platform_device *pdev)
171 sch->iobase = res->start; 171 sch->iobase = res->start;
172 sch->chip = sch_gpio_chip; 172 sch->chip = sch_gpio_chip;
173 sch->chip.label = dev_name(&pdev->dev); 173 sch->chip.label = dev_name(&pdev->dev);
174 sch->chip.dev = &pdev->dev; 174 sch->chip.parent = &pdev->dev;
175 175
176 switch (pdev->id) { 176 switch (pdev->id) {
177 case PCI_DEVICE_ID_INTEL_SCH_LPC: 177 case PCI_DEVICE_ID_INTEL_SCH_LPC:
diff --git a/drivers/gpio/gpio-sch311x.c b/drivers/gpio/gpio-sch311x.c
index 0cb11413e814..3841398d1078 100644
--- a/drivers/gpio/gpio-sch311x.c
+++ b/drivers/gpio/gpio-sch311x.c
@@ -149,7 +149,7 @@ static int sch311x_gpio_request(struct gpio_chip *chip, unsigned offset)
149 149
150 if (!request_region(block->runtime_reg + block->config_regs[offset], 150 if (!request_region(block->runtime_reg + block->config_regs[offset],
151 1, DRV_NAME)) { 151 1, DRV_NAME)) {
152 dev_err(chip->dev, "Failed to request region 0x%04x.\n", 152 dev_err(chip->parent, "Failed to request region 0x%04x.\n",
153 block->runtime_reg + block->config_regs[offset]); 153 block->runtime_reg + block->config_regs[offset]);
154 return -EBUSY; 154 return -EBUSY;
155 } 155 }
@@ -261,7 +261,7 @@ static int sch311x_gpio_probe(struct platform_device *pdev)
261 block->chip.get = sch311x_gpio_get; 261 block->chip.get = sch311x_gpio_get;
262 block->chip.set = sch311x_gpio_set; 262 block->chip.set = sch311x_gpio_set;
263 block->chip.ngpio = 8; 263 block->chip.ngpio = 8;
264 block->chip.dev = &pdev->dev; 264 block->chip.parent = &pdev->dev;
265 block->chip.base = sch311x_gpio_blocks[i].base; 265 block->chip.base = sch311x_gpio_blocks[i].base;
266 block->config_regs = sch311x_gpio_blocks[i].config_regs; 266 block->config_regs = sch311x_gpio_blocks[i].config_regs;
267 block->data_reg = sch311x_gpio_blocks[i].data_reg; 267 block->data_reg = sch311x_gpio_blocks[i].data_reg;
diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c
index 69ffca5b073b..bd436b7f86e1 100644
--- a/drivers/gpio/gpio-spear-spics.c
+++ b/drivers/gpio/gpio-spear-spics.c
@@ -164,7 +164,7 @@ static int spics_gpio_probe(struct platform_device *pdev)
164 spics->chip.get = spics_get_value; 164 spics->chip.get = spics_get_value;
165 spics->chip.set = spics_set_value; 165 spics->chip.set = spics_set_value;
166 spics->chip.label = dev_name(&pdev->dev); 166 spics->chip.label = dev_name(&pdev->dev);
167 spics->chip.dev = &pdev->dev; 167 spics->chip.parent = &pdev->dev;
168 spics->chip.owner = THIS_MODULE; 168 spics->chip.owner = THIS_MODULE;
169 spics->last_off = -1; 169 spics->last_off = -1;
170 170
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index dabfb99dddef..9e471979aa9e 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -356,7 +356,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
356 stmpe_gpio->stmpe = stmpe; 356 stmpe_gpio->stmpe = stmpe;
357 stmpe_gpio->chip = template_chip; 357 stmpe_gpio->chip = template_chip;
358 stmpe_gpio->chip.ngpio = stmpe->num_gpios; 358 stmpe_gpio->chip.ngpio = stmpe->num_gpios;
359 stmpe_gpio->chip.dev = &pdev->dev; 359 stmpe_gpio->chip.parent = &pdev->dev;
360 stmpe_gpio->chip.of_node = np; 360 stmpe_gpio->chip.of_node = np;
361 stmpe_gpio->chip.base = -1; 361 stmpe_gpio->chip.base = -1;
362 362
diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index 81bdbe7ba2a4..c250f21b9e40 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -139,7 +139,7 @@ static int xway_stp_request(struct gpio_chip *gc, unsigned gpio)
139 container_of(gc, struct xway_stp, gc); 139 container_of(gc, struct xway_stp, gc);
140 140
141 if ((gpio < 8) && (chip->reserved & BIT(gpio))) { 141 if ((gpio < 8) && (chip->reserved & BIT(gpio))) {
142 dev_err(gc->dev, "GPIO %d is driven by hardware\n", gpio); 142 dev_err(gc->parent, "GPIO %d is driven by hardware\n", gpio);
143 return -ENODEV; 143 return -ENODEV;
144 } 144 }
145 145
@@ -214,7 +214,7 @@ static int xway_stp_probe(struct platform_device *pdev)
214 if (IS_ERR(chip->virt)) 214 if (IS_ERR(chip->virt))
215 return PTR_ERR(chip->virt); 215 return PTR_ERR(chip->virt);
216 216
217 chip->gc.dev = &pdev->dev; 217 chip->gc.parent = &pdev->dev;
218 chip->gc.label = "stp-xway"; 218 chip->gc.label = "stp-xway";
219 chip->gc.direction_output = xway_stp_dir_out; 219 chip->gc.direction_output = xway_stp_dir_out;
220 chip->gc.set = xway_stp_set; 220 chip->gc.set = xway_stp_set;
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index 76f920173a2f..c0145159a127 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -473,7 +473,7 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
473 473
474 chip->client = client; 474 chip->client = client;
475 chip->dev_cfg = &sx150x_devices[driver_data]; 475 chip->dev_cfg = &sx150x_devices[driver_data];
476 chip->gpio_chip.dev = &client->dev; 476 chip->gpio_chip.parent = &client->dev;
477 chip->gpio_chip.label = client->name; 477 chip->gpio_chip.label = client->name;
478 chip->gpio_chip.direction_input = sx150x_gpio_direction_input; 478 chip->gpio_chip.direction_input = sx150x_gpio_direction_input;
479 chip->gpio_chip.direction_output = sx150x_gpio_direction_output; 479 chip->gpio_chip.direction_output = sx150x_gpio_direction_output;
diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 045a952576c7..cd6afee11f84 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -159,7 +159,7 @@ static void keystone_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
159 BIT(offs % SYSCON_REG_BITS) | KEYSTONE_LOCK_BIT, 159 BIT(offs % SYSCON_REG_BITS) | KEYSTONE_LOCK_BIT,
160 BIT(offs % SYSCON_REG_BITS) | KEYSTONE_LOCK_BIT); 160 BIT(offs % SYSCON_REG_BITS) | KEYSTONE_LOCK_BIT);
161 if (ret < 0) 161 if (ret < 0)
162 dev_err(chip->dev, "gpio write failed ret(%d)\n", ret); 162 dev_err(chip->parent, "gpio write failed ret(%d)\n", ret);
163} 163}
164 164
165static const struct syscon_gpio_data keystone_dsp_gpio = { 165static const struct syscon_gpio_data keystone_dsp_gpio = {
@@ -224,7 +224,7 @@ static int syscon_gpio_probe(struct platform_device *pdev)
224 priv->dir_reg_offset <<= 3; 224 priv->dir_reg_offset <<= 3;
225 } 225 }
226 226
227 priv->chip.dev = dev; 227 priv->chip.parent = dev;
228 priv->chip.owner = THIS_MODULE; 228 priv->chip.owner = THIS_MODULE;
229 priv->chip.label = dev_name(dev); 229 priv->chip.label = dev_name(dev);
230 priv->chip.base = -1; 230 priv->chip.base = -1;
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 4356e6c20fc5..1a7c3efae5d8 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -197,7 +197,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
197 return PTR_ERR(tb10x_gpio->base); 197 return PTR_ERR(tb10x_gpio->base);
198 198
199 tb10x_gpio->gc.label = of_node_full_name(dn); 199 tb10x_gpio->gc.label = of_node_full_name(dn);
200 tb10x_gpio->gc.dev = &pdev->dev; 200 tb10x_gpio->gc.parent = &pdev->dev;
201 tb10x_gpio->gc.owner = THIS_MODULE; 201 tb10x_gpio->gc.owner = THIS_MODULE;
202 tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in; 202 tb10x_gpio->gc.direction_input = tb10x_gpio_direction_in;
203 tb10x_gpio->gc.get = tb10x_gpio_get; 203 tb10x_gpio->gc.get = tb10x_gpio_get;
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index d1d585ddb9ab..7c1537ed6dff 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -258,7 +258,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
258 258
259 tc3589x_gpio->chip = template_chip; 259 tc3589x_gpio->chip = template_chip;
260 tc3589x_gpio->chip.ngpio = tc3589x->num_gpio; 260 tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
261 tc3589x_gpio->chip.dev = &pdev->dev; 261 tc3589x_gpio->chip.parent = &pdev->dev;
262 tc3589x_gpio->chip.base = -1; 262 tc3589x_gpio->chip.base = -1;
263 tc3589x_gpio->chip.of_node = np; 263 tc3589x_gpio->chip.of_node = np;
264 264
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index 30653e6319e9..dda8f21811eb 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -268,7 +268,7 @@ static int timbgpio_probe(struct platform_device *pdev)
268 268
269 gc->label = dev_name(&pdev->dev); 269 gc->label = dev_name(&pdev->dev);
270 gc->owner = THIS_MODULE; 270 gc->owner = THIS_MODULE;
271 gc->dev = &pdev->dev; 271 gc->parent = &pdev->dev;
272 gc->direction_input = timbgpio_gpio_direction_input; 272 gc->direction_input = timbgpio_gpio_direction_input;
273 gc->get = timbgpio_gpio_get; 273 gc->get = timbgpio_gpio_get;
274 gc->direction_output = timbgpio_gpio_direction_output; 274 gc->direction_output = timbgpio_gpio_direction_output;
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index 9c9238e838a9..89b2249100b0 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -104,7 +104,7 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
104 104
105 tps6586x_gpio->gpio_chip.owner = THIS_MODULE; 105 tps6586x_gpio->gpio_chip.owner = THIS_MODULE;
106 tps6586x_gpio->gpio_chip.label = pdev->name; 106 tps6586x_gpio->gpio_chip.label = pdev->name;
107 tps6586x_gpio->gpio_chip.dev = &pdev->dev; 107 tps6586x_gpio->gpio_chip.parent = &pdev->dev;
108 tps6586x_gpio->gpio_chip.ngpio = 4; 108 tps6586x_gpio->gpio_chip.ngpio = 4;
109 tps6586x_gpio->gpio_chip.can_sleep = true; 109 tps6586x_gpio->gpio_chip.can_sleep = true;
110 110
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index 88f1f5ff4e96..83894c0387fb 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -146,7 +146,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
146 tps65910_gpio->gpio_chip.direction_output = tps65910_gpio_output; 146 tps65910_gpio->gpio_chip.direction_output = tps65910_gpio_output;
147 tps65910_gpio->gpio_chip.set = tps65910_gpio_set; 147 tps65910_gpio->gpio_chip.set = tps65910_gpio_set;
148 tps65910_gpio->gpio_chip.get = tps65910_gpio_get; 148 tps65910_gpio->gpio_chip.get = tps65910_gpio_get;
149 tps65910_gpio->gpio_chip.dev = &pdev->dev; 149 tps65910_gpio->gpio_chip.parent = &pdev->dev;
150#ifdef CONFIG_OF_GPIO 150#ifdef CONFIG_OF_GPIO
151 tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node; 151 tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node;
152#endif 152#endif
diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c
index 9cdbc0c9cb2d..0f073ffa74cf 100644
--- a/drivers/gpio/gpio-tps65912.c
+++ b/drivers/gpio/gpio-tps65912.c
@@ -104,7 +104,7 @@ static int tps65912_gpio_probe(struct platform_device *pdev)
104 104
105 tps65912_gpio->tps65912 = tps65912; 105 tps65912_gpio->tps65912 = tps65912;
106 tps65912_gpio->gpio_chip = template_chip; 106 tps65912_gpio->gpio_chip = template_chip;
107 tps65912_gpio->gpio_chip.dev = &pdev->dev; 107 tps65912_gpio->gpio_chip.parent = &pdev->dev;
108 if (pdata && pdata->gpio_base) 108 if (pdata && pdata->gpio_base)
109 tps65912_gpio->gpio_chip.base = pdata->gpio_base; 109 tps65912_gpio->gpio_chip.base = pdata->gpio_base;
110 110
diff --git a/drivers/gpio/gpio-ts5500.c b/drivers/gpio/gpio-ts5500.c
index b29a102d136b..aafe7910e030 100644
--- a/drivers/gpio/gpio-ts5500.c
+++ b/drivers/gpio/gpio-ts5500.c
@@ -315,7 +315,8 @@ static void ts5500_disable_irq(struct ts5500_priv *priv)
315 else if (priv->hwirq == 1) 315 else if (priv->hwirq == 1)
316 ts5500_clear_mask(BIT(6), 0x7d); /* LCD_RS on IRQ1 */ 316 ts5500_clear_mask(BIT(6), 0x7d); /* LCD_RS on IRQ1 */
317 else 317 else
318 dev_err(priv->gpio_chip.dev, "invalid hwirq %d\n", priv->hwirq); 318 dev_err(priv->gpio_chip.parent, "invalid hwirq %d\n",
319 priv->hwirq);
319 spin_unlock_irqrestore(&priv->lock, flags); 320 spin_unlock_irqrestore(&priv->lock, flags);
320} 321}
321 322
@@ -346,7 +347,7 @@ static int ts5500_dio_probe(struct platform_device *pdev)
346 347
347 priv->gpio_chip.owner = THIS_MODULE; 348 priv->gpio_chip.owner = THIS_MODULE;
348 priv->gpio_chip.label = name; 349 priv->gpio_chip.label = name;
349 priv->gpio_chip.dev = dev; 350 priv->gpio_chip.parent = dev;
350 priv->gpio_chip.direction_input = ts5500_gpio_input; 351 priv->gpio_chip.direction_input = ts5500_gpio_input;
351 priv->gpio_chip.direction_output = ts5500_gpio_output; 352 priv->gpio_chip.direction_output = ts5500_gpio_output;
352 priv->gpio_chip.get = ts5500_gpio_get; 353 priv->gpio_chip.get = ts5500_gpio_get;
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index 9e1dbb9877c1..14f40bf64e34 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -256,7 +256,7 @@ static int twl_request(struct gpio_chip *chip, unsigned offset)
256 /* optionally have the first two GPIOs switch vMMC1 256 /* optionally have the first two GPIOs switch vMMC1
257 * and vMMC2 power supplies based on card presence. 257 * and vMMC2 power supplies based on card presence.
258 */ 258 */
259 pdata = dev_get_platdata(chip->dev); 259 pdata = dev_get_platdata(chip->parent);
260 if (pdata) 260 if (pdata)
261 value |= pdata->mmc_cd & 0x03; 261 value |= pdata->mmc_cd & 0x03;
262 262
@@ -509,7 +509,7 @@ no_irqs:
509 priv->gpio_chip = template_chip; 509 priv->gpio_chip = template_chip;
510 priv->gpio_chip.base = -1; 510 priv->gpio_chip.base = -1;
511 priv->gpio_chip.ngpio = TWL4030_GPIO_MAX; 511 priv->gpio_chip.ngpio = TWL4030_GPIO_MAX;
512 priv->gpio_chip.dev = &pdev->dev; 512 priv->gpio_chip.parent = &pdev->dev;
513 513
514 mutex_init(&priv->mutex); 514 mutex_init(&priv->mutex);
515 515
diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c
index c946e7eef3ee..2da7c5f70034 100644
--- a/drivers/gpio/gpio-twl6040.c
+++ b/drivers/gpio/gpio-twl6040.c
@@ -36,7 +36,7 @@ static struct gpio_chip twl6040gpo_chip;
36 36
37static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset) 37static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset)
38{ 38{
39 struct twl6040 *twl6040 = dev_get_drvdata(chip->dev->parent); 39 struct twl6040 *twl6040 = dev_get_drvdata(chip->parent->parent);
40 int ret = 0; 40 int ret = 0;
41 41
42 ret = twl6040_reg_read(twl6040, TWL6040_REG_GPOCTL); 42 ret = twl6040_reg_read(twl6040, TWL6040_REG_GPOCTL);
@@ -55,7 +55,7 @@ static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset,
55 55
56static void twl6040gpo_set(struct gpio_chip *chip, unsigned offset, int value) 56static void twl6040gpo_set(struct gpio_chip *chip, unsigned offset, int value)
57{ 57{
58 struct twl6040 *twl6040 = dev_get_drvdata(chip->dev->parent); 58 struct twl6040 *twl6040 = dev_get_drvdata(chip->parent->parent);
59 int ret; 59 int ret;
60 u8 gpoctl; 60 u8 gpoctl;
61 61
@@ -95,7 +95,7 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
95 else 95 else
96 twl6040gpo_chip.ngpio = 1; /* twl6041 have 1 GPO */ 96 twl6040gpo_chip.ngpio = 1; /* twl6041 have 1 GPO */
97 97
98 twl6040gpo_chip.dev = &pdev->dev; 98 twl6040gpo_chip.parent = &pdev->dev;
99#ifdef CONFIG_OF_GPIO 99#ifdef CONFIG_OF_GPIO
100 twl6040gpo_chip.of_node = twl6040_core_dev->of_node; 100 twl6040gpo_chip.of_node = twl6040_core_dev->of_node;
101#endif 101#endif
diff --git a/drivers/gpio/gpio-tz1090-pdc.c b/drivers/gpio/gpio-tz1090-pdc.c
index 3623d009d808..a974397164b2 100644
--- a/drivers/gpio/gpio-tz1090-pdc.c
+++ b/drivers/gpio/gpio-tz1090-pdc.c
@@ -188,7 +188,7 @@ static int tz1090_pdc_gpio_probe(struct platform_device *pdev)
188 188
189 /* Set up GPIO chip */ 189 /* Set up GPIO chip */
190 priv->chip.label = "tz1090-pdc-gpio"; 190 priv->chip.label = "tz1090-pdc-gpio";
191 priv->chip.dev = &pdev->dev; 191 priv->chip.parent = &pdev->dev;
192 priv->chip.direction_input = tz1090_pdc_gpio_direction_input; 192 priv->chip.direction_input = tz1090_pdc_gpio_direction_input;
193 priv->chip.direction_output = tz1090_pdc_gpio_direction_output; 193 priv->chip.direction_output = tz1090_pdc_gpio_direction_output;
194 priv->chip.get = tz1090_pdc_gpio_get; 194 priv->chip.get = tz1090_pdc_gpio_get;
diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c
index 87bb1b1eee8d..7858d90202f3 100644
--- a/drivers/gpio/gpio-tz1090.c
+++ b/drivers/gpio/gpio-tz1090.c
@@ -425,7 +425,7 @@ static int tz1090_gpio_bank_probe(struct tz1090_gpio_bank_info *info)
425 snprintf(bank->label, sizeof(bank->label), "tz1090-gpio-%u", 425 snprintf(bank->label, sizeof(bank->label), "tz1090-gpio-%u",
426 info->index); 426 info->index);
427 bank->chip.label = bank->label; 427 bank->chip.label = bank->label;
428 bank->chip.dev = dev; 428 bank->chip.parent = dev;
429 bank->chip.direction_input = tz1090_gpio_direction_input; 429 bank->chip.direction_input = tz1090_gpio_direction_input;
430 bank->chip.direction_output = tz1090_gpio_direction_output; 430 bank->chip.direction_output = tz1090_gpio_direction_output;
431 bank->chip.get = tz1090_gpio_get; 431 bank->chip.get = tz1090_gpio_get;
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 87b950cec6ec..9031e60c815c 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -249,7 +249,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
249 249
250 gc = &port->gc; 250 gc = &port->gc;
251 gc->of_node = np; 251 gc->of_node = np;
252 gc->dev = dev; 252 gc->parent = dev;
253 gc->label = "vf610-gpio"; 253 gc->label = "vf610-gpio";
254 gc->ngpio = VF610_GPIO_PER_PORT; 254 gc->ngpio = VF610_GPIO_PER_PORT;
255 gc->base = of_alias_get_id(np, "gpio") * VF610_GPIO_PER_PORT; 255 gc->base = of_alias_get_id(np, "gpio") * VF610_GPIO_PER_PORT;
diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
index e2a11f27807f..26e7edb74f42 100644
--- a/drivers/gpio/gpio-viperboard.c
+++ b/drivers/gpio/gpio-viperboard.c
@@ -173,7 +173,7 @@ static void vprbrd_gpioa_set(struct gpio_chip *chip,
173 mutex_unlock(&vb->lock); 173 mutex_unlock(&vb->lock);
174 174
175 if (ret != sizeof(struct vprbrd_gpioa_msg)) 175 if (ret != sizeof(struct vprbrd_gpioa_msg))
176 dev_err(chip->dev, "usb error setting pin value\n"); 176 dev_err(chip->parent, "usb error setting pin value\n");
177 } 177 }
178} 178}
179 179
@@ -345,7 +345,7 @@ static void vprbrd_gpiob_set(struct gpio_chip *chip,
345 mutex_unlock(&vb->lock); 345 mutex_unlock(&vb->lock);
346 346
347 if (ret != sizeof(struct vprbrd_gpiob_msg)) 347 if (ret != sizeof(struct vprbrd_gpiob_msg))
348 dev_err(chip->dev, "usb error setting pin value\n"); 348 dev_err(chip->parent, "usb error setting pin value\n");
349 } 349 }
350} 350}
351 351
@@ -366,7 +366,7 @@ static int vprbrd_gpiob_direction_input(struct gpio_chip *chip,
366 mutex_unlock(&vb->lock); 366 mutex_unlock(&vb->lock);
367 367
368 if (ret) 368 if (ret)
369 dev_err(chip->dev, "usb error setting pin to input\n"); 369 dev_err(chip->parent, "usb error setting pin to input\n");
370 370
371 return ret; 371 return ret;
372} 372}
@@ -385,7 +385,7 @@ static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
385 385
386 ret = vprbrd_gpiob_setdir(vb, offset, 1); 386 ret = vprbrd_gpiob_setdir(vb, offset, 1);
387 if (ret) 387 if (ret)
388 dev_err(chip->dev, "usb error setting pin to output\n"); 388 dev_err(chip->parent, "usb error setting pin to output\n");
389 389
390 mutex_unlock(&vb->lock); 390 mutex_unlock(&vb->lock);
391 391
@@ -409,7 +409,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
409 vb_gpio->vb = vb; 409 vb_gpio->vb = vb;
410 /* registering gpio a */ 410 /* registering gpio a */
411 vb_gpio->gpioa.label = "viperboard gpio a"; 411 vb_gpio->gpioa.label = "viperboard gpio a";
412 vb_gpio->gpioa.dev = &pdev->dev; 412 vb_gpio->gpioa.parent = &pdev->dev;
413 vb_gpio->gpioa.owner = THIS_MODULE; 413 vb_gpio->gpioa.owner = THIS_MODULE;
414 vb_gpio->gpioa.base = -1; 414 vb_gpio->gpioa.base = -1;
415 vb_gpio->gpioa.ngpio = 16; 415 vb_gpio->gpioa.ngpio = 16;
@@ -420,13 +420,13 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
420 vb_gpio->gpioa.direction_output = vprbrd_gpioa_direction_output; 420 vb_gpio->gpioa.direction_output = vprbrd_gpioa_direction_output;
421 ret = gpiochip_add(&vb_gpio->gpioa); 421 ret = gpiochip_add(&vb_gpio->gpioa);
422 if (ret < 0) { 422 if (ret < 0) {
423 dev_err(vb_gpio->gpioa.dev, "could not add gpio a"); 423 dev_err(vb_gpio->gpioa.parent, "could not add gpio a");
424 goto err_gpioa; 424 goto err_gpioa;
425 } 425 }
426 426
427 /* registering gpio b */ 427 /* registering gpio b */
428 vb_gpio->gpiob.label = "viperboard gpio b"; 428 vb_gpio->gpiob.label = "viperboard gpio b";
429 vb_gpio->gpiob.dev = &pdev->dev; 429 vb_gpio->gpiob.parent = &pdev->dev;
430 vb_gpio->gpiob.owner = THIS_MODULE; 430 vb_gpio->gpiob.owner = THIS_MODULE;
431 vb_gpio->gpiob.base = -1; 431 vb_gpio->gpiob.base = -1;
432 vb_gpio->gpiob.ngpio = 16; 432 vb_gpio->gpiob.ngpio = 16;
@@ -437,7 +437,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
437 vb_gpio->gpiob.direction_output = vprbrd_gpiob_direction_output; 437 vb_gpio->gpiob.direction_output = vprbrd_gpiob_direction_output;
438 ret = gpiochip_add(&vb_gpio->gpiob); 438 ret = gpiochip_add(&vb_gpio->gpiob);
439 if (ret < 0) { 439 if (ret < 0) {
440 dev_err(vb_gpio->gpiob.dev, "could not add gpio b"); 440 dev_err(vb_gpio->gpiob.parent, "could not add gpio b");
441 goto err_gpiob; 441 goto err_gpiob;
442 } 442 }
443 443
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
index c1caa459c02d..1947531b7cf5 100644
--- a/drivers/gpio/gpio-vr41xx.c
+++ b/drivers/gpio/gpio-vr41xx.c
@@ -139,7 +139,7 @@ static void unmask_giuint_low(struct irq_data *d)
139static unsigned int startup_giuint(struct irq_data *data) 139static unsigned int startup_giuint(struct irq_data *data)
140{ 140{
141 if (gpiochip_lock_as_irq(&vr41xx_gpio_chip, data->hwirq)) 141 if (gpiochip_lock_as_irq(&vr41xx_gpio_chip, data->hwirq))
142 dev_err(vr41xx_gpio_chip.dev, 142 dev_err(vr41xx_gpio_chip.parent,
143 "unable to lock HW IRQ %lu for IRQ\n", 143 "unable to lock HW IRQ %lu for IRQ\n",
144 data->hwirq); 144 data->hwirq);
145 /* Satisfy the .enable semantics by unmasking the line */ 145 /* Satisfy the .enable semantics by unmasking the line */
@@ -542,7 +542,7 @@ static int giu_probe(struct platform_device *pdev)
542 if (!giu_base) 542 if (!giu_base)
543 return -ENOMEM; 543 return -ENOMEM;
544 544
545 vr41xx_gpio_chip.dev = &pdev->dev; 545 vr41xx_gpio_chip.parent = &pdev->dev;
546 546
547 ret = gpiochip_add(&vr41xx_gpio_chip); 547 ret = gpiochip_add(&vr41xx_gpio_chip);
548 if (!ret) { 548 if (!ret) {
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 58ce75c188b7..2e73e4b52c69 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -258,7 +258,7 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
258 wm831x_gpio->wm831x = wm831x; 258 wm831x_gpio->wm831x = wm831x;
259 wm831x_gpio->gpio_chip = template_chip; 259 wm831x_gpio->gpio_chip = template_chip;
260 wm831x_gpio->gpio_chip.ngpio = wm831x->num_gpio; 260 wm831x_gpio->gpio_chip.ngpio = wm831x->num_gpio;
261 wm831x_gpio->gpio_chip.dev = &pdev->dev; 261 wm831x_gpio->gpio_chip.parent = &pdev->dev;
262 if (pdata && pdata->gpio_base) 262 if (pdata && pdata->gpio_base)
263 wm831x_gpio->gpio_chip.base = pdata->gpio_base; 263 wm831x_gpio->gpio_chip.base = pdata->gpio_base;
264 else 264 else
diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c
index 060b89303bb6..1e3d8da61ff3 100644
--- a/drivers/gpio/gpio-wm8350.c
+++ b/drivers/gpio/gpio-wm8350.c
@@ -124,7 +124,7 @@ static int wm8350_gpio_probe(struct platform_device *pdev)
124 wm8350_gpio->wm8350 = wm8350; 124 wm8350_gpio->wm8350 = wm8350;
125 wm8350_gpio->gpio_chip = template_chip; 125 wm8350_gpio->gpio_chip = template_chip;
126 wm8350_gpio->gpio_chip.ngpio = 13; 126 wm8350_gpio->gpio_chip.ngpio = 13;
127 wm8350_gpio->gpio_chip.dev = &pdev->dev; 127 wm8350_gpio->gpio_chip.parent = &pdev->dev;
128 if (pdata && pdata->gpio_base) 128 if (pdata && pdata->gpio_base)
129 wm8350_gpio->gpio_chip.base = pdata->gpio_base; 129 wm8350_gpio->gpio_chip.base = pdata->gpio_base;
130 else 130 else
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index 6f5e42db4b9e..de73c80163c1 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -260,7 +260,7 @@ static int wm8994_gpio_probe(struct platform_device *pdev)
260 wm8994_gpio->wm8994 = wm8994; 260 wm8994_gpio->wm8994 = wm8994;
261 wm8994_gpio->gpio_chip = template_chip; 261 wm8994_gpio->gpio_chip = template_chip;
262 wm8994_gpio->gpio_chip.ngpio = WM8994_GPIO_MAX; 262 wm8994_gpio->gpio_chip.ngpio = WM8994_GPIO_MAX;
263 wm8994_gpio->gpio_chip.dev = &pdev->dev; 263 wm8994_gpio->gpio_chip.parent = &pdev->dev;
264 if (pdata && pdata->gpio_base) 264 if (pdata && pdata->gpio_base)
265 wm8994_gpio->gpio_chip.base = pdata->gpio_base; 265 wm8994_gpio->gpio_chip.base = pdata->gpio_base;
266 else 266 else
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 18a8182d4fec..b8ceb71885f6 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -188,7 +188,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
188 gpio->chip.ngpio = XGENE_MAX_GPIOS; 188 gpio->chip.ngpio = XGENE_MAX_GPIOS;
189 189
190 spin_lock_init(&gpio->lock); 190 spin_lock_init(&gpio->lock);
191 gpio->chip.dev = &pdev->dev; 191 gpio->chip.parent = &pdev->dev;
192 gpio->chip.direction_input = xgene_gpio_dir_in; 192 gpio->chip.direction_input = xgene_gpio_dir_in;
193 gpio->chip.direction_output = xgene_gpio_dir_out; 193 gpio->chip.direction_output = xgene_gpio_dir_out;
194 gpio->chip.get = xgene_gpio_get; 194 gpio->chip.get = xgene_gpio_get;
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index d5284dfe01fe..5c2971e1cb08 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -305,7 +305,7 @@ static int xgpio_probe(struct platform_device *pdev)
305 } 305 }
306 306
307 chip->mmchip.gc.ngpio = chip->gpio_width[0] + chip->gpio_width[1]; 307 chip->mmchip.gc.ngpio = chip->gpio_width[0] + chip->gpio_width[1];
308 chip->mmchip.gc.dev = &pdev->dev; 308 chip->mmchip.gc.parent = &pdev->dev;
309 chip->mmchip.gc.direction_input = xgpio_dir_in; 309 chip->mmchip.gc.direction_input = xgpio_dir_in;
310 chip->mmchip.gc.direction_output = xgpio_dir_out; 310 chip->mmchip.gc.direction_output = xgpio_dir_out;
311 chip->mmchip.gc.get = xgpio_get; 311 chip->mmchip.gc.get = xgpio_get;
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index bc06a2cd2c1d..3f31aac2ba3c 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -373,7 +373,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
373 gc->owner = THIS_MODULE; 373 gc->owner = THIS_MODULE;
374 gc->label = dev_name(&pdev->dev); 374 gc->label = dev_name(&pdev->dev);
375 gc->base = 0; 375 gc->base = 0;
376 gc->dev = &pdev->dev; 376 gc->parent = &pdev->dev;
377 gc->ngpio = ngpio; 377 gc->ngpio = ngpio;
378 gc->of_node = pdev->dev.of_node; 378 gc->of_node = pdev->dev.of_node;
379 gc->direction_output = xlp_gpio_dir_output; 379 gc->direction_output = xlp_gpio_dir_output;
diff --git a/drivers/gpio/gpio-zevio.c b/drivers/gpio/gpio-zevio.c
index 6f02d7c4cc57..65b61dcc6268 100644
--- a/drivers/gpio/gpio-zevio.c
+++ b/drivers/gpio/gpio-zevio.c
@@ -185,7 +185,7 @@ static int zevio_gpio_probe(struct platform_device *pdev)
185 185
186 /* Copy our reference */ 186 /* Copy our reference */
187 controller->chip.gc = zevio_gpio_chip; 187 controller->chip.gc = zevio_gpio_chip;
188 controller->chip.gc.dev = &pdev->dev; 188 controller->chip.gc.parent = &pdev->dev;
189 189
190 status = of_mm_gpiochip_add(pdev->dev.of_node, &(controller->chip)); 190 status = of_mm_gpiochip_add(pdev->dev.of_node, &(controller->chip));
191 if (status) { 191 if (status) {
@@ -199,7 +199,7 @@ static int zevio_gpio_probe(struct platform_device *pdev)
199 for (i = 0; i < controller->chip.gc.ngpio; i += 8) 199 for (i = 0; i < controller->chip.gc.ngpio; i += 8)
200 zevio_gpio_port_set(controller, i, ZEVIO_GPIO_INT_MASK, 0xFF); 200 zevio_gpio_port_set(controller, i, ZEVIO_GPIO_INT_MASK, 0xFF);
201 201
202 dev_dbg(controller->chip.gc.dev, "ZEVIO GPIO controller set up!\n"); 202 dev_dbg(controller->chip.gc.parent, "ZEVIO GPIO controller set up!\n");
203 203
204 return 0; 204 return 0;
205} 205}
diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c
index 1dcf7a66dd36..ab2e54fa46cf 100644
--- a/drivers/gpio/gpio-zx.c
+++ b/drivers/gpio/gpio-zx.c
@@ -245,7 +245,7 @@ static int zx_gpio_probe(struct platform_device *pdev)
245 chip->gc.base = ZX_GPIO_NR * id; 245 chip->gc.base = ZX_GPIO_NR * id;
246 chip->gc.ngpio = ZX_GPIO_NR; 246 chip->gc.ngpio = ZX_GPIO_NR;
247 chip->gc.label = dev_name(dev); 247 chip->gc.label = dev_name(dev);
248 chip->gc.dev = dev; 248 chip->gc.parent = dev;
249 chip->gc.owner = THIS_MODULE; 249 chip->gc.owner = THIS_MODULE;
250 250
251 ret = gpiochip_add(&chip->gc); 251 ret = gpiochip_add(&chip->gc);
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 8abeacac5885..8a04e00bef32 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -592,7 +592,7 @@ static int zynq_gpio_request(struct gpio_chip *chip, unsigned offset)
592{ 592{
593 int ret; 593 int ret;
594 594
595 ret = pm_runtime_get_sync(chip->dev); 595 ret = pm_runtime_get_sync(chip->parent);
596 596
597 /* 597 /*
598 * If the device is already active pm_runtime_get() will return 1 on 598 * If the device is already active pm_runtime_get() will return 1 on
@@ -603,7 +603,7 @@ static int zynq_gpio_request(struct gpio_chip *chip, unsigned offset)
603 603
604static void zynq_gpio_free(struct gpio_chip *chip, unsigned offset) 604static void zynq_gpio_free(struct gpio_chip *chip, unsigned offset)
605{ 605{
606 pm_runtime_put(chip->dev); 606 pm_runtime_put(chip->parent);
607} 607}
608 608
609static const struct dev_pm_ops zynq_gpio_dev_pm_ops = { 609static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
@@ -698,7 +698,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
698 chip = &gpio->chip; 698 chip = &gpio->chip;
699 chip->label = gpio->p_data->label; 699 chip->label = gpio->p_data->label;
700 chip->owner = THIS_MODULE; 700 chip->owner = THIS_MODULE;
701 chip->dev = &pdev->dev; 701 chip->parent = &pdev->dev;
702 chip->get = zynq_gpio_get_value; 702 chip->get = zynq_gpio_get_value;
703 chip->set = zynq_gpio_set_value; 703 chip->set = zynq_gpio_set_value;
704 chip->request = zynq_gpio_request; 704 chip->request = zynq_gpio_request;
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 16a7b6816744..e4620e14457f 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -51,10 +51,10 @@ struct acpi_gpio_chip {
51 51
52static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) 52static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
53{ 53{
54 if (!gc->dev) 54 if (!gc->parent)
55 return false; 55 return false;
56 56
57 return ACPI_HANDLE(gc->dev) == data; 57 return ACPI_HANDLE(gc->parent) == data;
58} 58}
59 59
60#ifdef CONFIG_PINCTRL 60#ifdef CONFIG_PINCTRL
@@ -184,7 +184,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
184 if (agpio->connection_type != ACPI_RESOURCE_GPIO_TYPE_INT) 184 if (agpio->connection_type != ACPI_RESOURCE_GPIO_TYPE_INT)
185 return AE_OK; 185 return AE_OK;
186 186
187 handle = ACPI_HANDLE(chip->dev); 187 handle = ACPI_HANDLE(chip->parent);
188 pin = agpio->pin_table[0]; 188 pin = agpio->pin_table[0];
189 189
190 if (pin <= 255) { 190 if (pin <= 255) {
@@ -208,7 +208,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
208 208
209 desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event"); 209 desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event");
210 if (IS_ERR(desc)) { 210 if (IS_ERR(desc)) {
211 dev_err(chip->dev, "Failed to request GPIO\n"); 211 dev_err(chip->parent, "Failed to request GPIO\n");
212 return AE_ERROR; 212 return AE_ERROR;
213 } 213 }
214 214
@@ -216,13 +216,13 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
216 216
217 ret = gpiochip_lock_as_irq(chip, pin); 217 ret = gpiochip_lock_as_irq(chip, pin);
218 if (ret) { 218 if (ret) {
219 dev_err(chip->dev, "Failed to lock GPIO as interrupt\n"); 219 dev_err(chip->parent, "Failed to lock GPIO as interrupt\n");
220 goto fail_free_desc; 220 goto fail_free_desc;
221 } 221 }
222 222
223 irq = gpiod_to_irq(desc); 223 irq = gpiod_to_irq(desc);
224 if (irq < 0) { 224 if (irq < 0) {
225 dev_err(chip->dev, "Failed to translate GPIO to IRQ\n"); 225 dev_err(chip->parent, "Failed to translate GPIO to IRQ\n");
226 goto fail_unlock_irq; 226 goto fail_unlock_irq;
227 } 227 }
228 228
@@ -259,7 +259,8 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
259 ret = request_threaded_irq(event->irq, NULL, handler, irqflags, 259 ret = request_threaded_irq(event->irq, NULL, handler, irqflags,
260 "ACPI:Event", event); 260 "ACPI:Event", event);
261 if (ret) { 261 if (ret) {
262 dev_err(chip->dev, "Failed to setup interrupt handler for %d\n", 262 dev_err(chip->parent,
263 "Failed to setup interrupt handler for %d\n",
263 event->irq); 264 event->irq);
264 goto fail_free_event; 265 goto fail_free_event;
265 } 266 }
@@ -293,10 +294,10 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip)
293 acpi_handle handle; 294 acpi_handle handle;
294 acpi_status status; 295 acpi_status status;
295 296
296 if (!chip->dev || !chip->to_irq) 297 if (!chip->parent || !chip->to_irq)
297 return; 298 return;
298 299
299 handle = ACPI_HANDLE(chip->dev); 300 handle = ACPI_HANDLE(chip->parent);
300 if (!handle) 301 if (!handle)
301 return; 302 return;
302 303
@@ -323,10 +324,10 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
323 acpi_handle handle; 324 acpi_handle handle;
324 acpi_status status; 325 acpi_status status;
325 326
326 if (!chip->dev || !chip->to_irq) 327 if (!chip->parent || !chip->to_irq)
327 return; 328 return;
328 329
329 handle = ACPI_HANDLE(chip->dev); 330 handle = ACPI_HANDLE(chip->parent);
330 if (!handle) 331 if (!handle)
331 return; 332 return;
332 333
@@ -748,7 +749,7 @@ out:
748static void acpi_gpiochip_request_regions(struct acpi_gpio_chip *achip) 749static void acpi_gpiochip_request_regions(struct acpi_gpio_chip *achip)
749{ 750{
750 struct gpio_chip *chip = achip->chip; 751 struct gpio_chip *chip = achip->chip;
751 acpi_handle handle = ACPI_HANDLE(chip->dev); 752 acpi_handle handle = ACPI_HANDLE(chip->parent);
752 acpi_status status; 753 acpi_status status;
753 754
754 INIT_LIST_HEAD(&achip->conns); 755 INIT_LIST_HEAD(&achip->conns);
@@ -757,20 +758,22 @@ static void acpi_gpiochip_request_regions(struct acpi_gpio_chip *achip)
757 acpi_gpio_adr_space_handler, 758 acpi_gpio_adr_space_handler,
758 NULL, achip); 759 NULL, achip);
759 if (ACPI_FAILURE(status)) 760 if (ACPI_FAILURE(status))
760 dev_err(chip->dev, "Failed to install GPIO OpRegion handler\n"); 761 dev_err(chip->parent,
762 "Failed to install GPIO OpRegion handler\n");
761} 763}
762 764
763static void acpi_gpiochip_free_regions(struct acpi_gpio_chip *achip) 765static void acpi_gpiochip_free_regions(struct acpi_gpio_chip *achip)
764{ 766{
765 struct gpio_chip *chip = achip->chip; 767 struct gpio_chip *chip = achip->chip;
766 acpi_handle handle = ACPI_HANDLE(chip->dev); 768 acpi_handle handle = ACPI_HANDLE(chip->parent);
767 struct acpi_gpio_connection *conn, *tmp; 769 struct acpi_gpio_connection *conn, *tmp;
768 acpi_status status; 770 acpi_status status;
769 771
770 status = acpi_remove_address_space_handler(handle, ACPI_ADR_SPACE_GPIO, 772 status = acpi_remove_address_space_handler(handle, ACPI_ADR_SPACE_GPIO,
771 acpi_gpio_adr_space_handler); 773 acpi_gpio_adr_space_handler);
772 if (ACPI_FAILURE(status)) { 774 if (ACPI_FAILURE(status)) {
773 dev_err(chip->dev, "Failed to remove GPIO OpRegion handler\n"); 775 dev_err(chip->parent,
776 "Failed to remove GPIO OpRegion handler\n");
774 return; 777 return;
775 } 778 }
776 779
@@ -787,16 +790,16 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
787 acpi_handle handle; 790 acpi_handle handle;
788 acpi_status status; 791 acpi_status status;
789 792
790 if (!chip || !chip->dev) 793 if (!chip || !chip->parent)
791 return; 794 return;
792 795
793 handle = ACPI_HANDLE(chip->dev); 796 handle = ACPI_HANDLE(chip->parent);
794 if (!handle) 797 if (!handle)
795 return; 798 return;
796 799
797 acpi_gpio = kzalloc(sizeof(*acpi_gpio), GFP_KERNEL); 800 acpi_gpio = kzalloc(sizeof(*acpi_gpio), GFP_KERNEL);
798 if (!acpi_gpio) { 801 if (!acpi_gpio) {
799 dev_err(chip->dev, 802 dev_err(chip->parent,
800 "Failed to allocate memory for ACPI GPIO chip\n"); 803 "Failed to allocate memory for ACPI GPIO chip\n");
801 return; 804 return;
802 } 805 }
@@ -806,7 +809,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
806 809
807 status = acpi_attach_data(handle, acpi_gpio_chip_dh, acpi_gpio); 810 status = acpi_attach_data(handle, acpi_gpio_chip_dh, acpi_gpio);
808 if (ACPI_FAILURE(status)) { 811 if (ACPI_FAILURE(status)) {
809 dev_err(chip->dev, "Failed to attach ACPI GPIO chip\n"); 812 dev_err(chip->parent, "Failed to attach ACPI GPIO chip\n");
810 kfree(acpi_gpio); 813 kfree(acpi_gpio);
811 return; 814 return;
812 } 815 }
@@ -820,16 +823,16 @@ void acpi_gpiochip_remove(struct gpio_chip *chip)
820 acpi_handle handle; 823 acpi_handle handle;
821 acpi_status status; 824 acpi_status status;
822 825
823 if (!chip || !chip->dev) 826 if (!chip || !chip->parent)
824 return; 827 return;
825 828
826 handle = ACPI_HANDLE(chip->dev); 829 handle = ACPI_HANDLE(chip->parent);
827 if (!handle) 830 if (!handle)
828 return; 831 return;
829 832
830 status = acpi_get_data(handle, acpi_gpio_chip_dh, (void **)&acpi_gpio); 833 status = acpi_get_data(handle, acpi_gpio_chip_dh, (void **)&acpi_gpio);
831 if (ACPI_FAILURE(status)) { 834 if (ACPI_FAILURE(status)) {
832 dev_warn(chip->dev, "Failed to retrieve ACPI GPIO chip\n"); 835 dev_warn(chip->parent, "Failed to retrieve ACPI GPIO chip\n");
833 return; 836 return;
834 } 837 }
835 838
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 5fe34a9df3e6..6ed465ea2e12 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -423,8 +423,8 @@ int of_gpiochip_add(struct gpio_chip *chip)
423{ 423{
424 int status; 424 int status;
425 425
426 if ((!chip->of_node) && (chip->dev)) 426 if ((!chip->of_node) && (chip->parent))
427 chip->of_node = chip->dev->of_node; 427 chip->of_node = chip->parent->of_node;
428 428
429 if (!chip->of_node) 429 if (!chip->of_node)
430 return 0; 430 return 0;
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index b57ed8e55ab5..405dfcaadc4c 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -605,7 +605,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
605 if (chip->names && chip->names[offset]) 605 if (chip->names && chip->names[offset])
606 ioname = chip->names[offset]; 606 ioname = chip->names[offset];
607 607
608 dev = device_create_with_groups(&gpio_class, chip->dev, 608 dev = device_create_with_groups(&gpio_class, chip->parent,
609 MKDEV(0, 0), data, gpio_groups, 609 MKDEV(0, 0), data, gpio_groups,
610 ioname ? ioname : "gpio%u", 610 ioname ? ioname : "gpio%u",
611 desc_to_gpio(desc)); 611 desc_to_gpio(desc));
@@ -730,7 +730,8 @@ int gpiochip_sysfs_register(struct gpio_chip *chip)
730 return 0; 730 return 0;
731 731
732 /* use chip->base for the ID; it's already known to be unique */ 732 /* use chip->base for the ID; it's already known to be unique */
733 dev = device_create_with_groups(&gpio_class, chip->dev, MKDEV(0, 0), 733 dev = device_create_with_groups(&gpio_class, chip->parent,
734 MKDEV(0, 0),
734 chip, gpiochip_groups, 735 chip, gpiochip_groups,
735 "gpiochip%d", chip->base); 736 "gpiochip%d", chip->base);
736 if (IS_ERR(dev)) 737 if (IS_ERR(dev))
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a18f00fc1bb8..8b35457013da 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -205,8 +205,8 @@ static int gpiochip_add_to_list(struct gpio_chip *chip)
205 if (pos != &gpio_chips && pos->prev != &gpio_chips) { 205 if (pos != &gpio_chips && pos->prev != &gpio_chips) {
206 _chip = list_entry(pos->prev, struct gpio_chip, list); 206 _chip = list_entry(pos->prev, struct gpio_chip, list);
207 if (_chip->base + _chip->ngpio > chip->base) { 207 if (_chip->base + _chip->ngpio > chip->base) {
208 dev_err(chip->dev, 208 dev_err(chip->parent,
209 "GPIO integer space overlap, cannot add chip\n"); 209 "GPIO integer space overlap, cannot add chip\n");
210 err = -EBUSY; 210 err = -EBUSY;
211 } 211 }
212 } 212 }
@@ -267,7 +267,7 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
267 267
268 gpio = gpio_name_to_desc(gc->names[i]); 268 gpio = gpio_name_to_desc(gc->names[i]);
269 if (gpio) 269 if (gpio)
270 dev_warn(gc->dev, "Detected name collision for " 270 dev_warn(gc->parent, "Detected name collision for "
271 "GPIO name '%s'\n", 271 "GPIO name '%s'\n",
272 gc->names[i]); 272 gc->names[i]);
273 } 273 }
@@ -348,8 +348,8 @@ int gpiochip_add(struct gpio_chip *chip)
348 INIT_LIST_HEAD(&chip->pin_ranges); 348 INIT_LIST_HEAD(&chip->pin_ranges);
349#endif 349#endif
350 350
351 if (!chip->owner && chip->dev && chip->dev->driver) 351 if (!chip->owner && chip->parent && chip->parent->driver)
352 chip->owner = chip->dev->driver->owner; 352 chip->owner = chip->parent->driver->owner;
353 353
354 status = gpiochip_set_desc_names(chip); 354 status = gpiochip_set_desc_names(chip);
355 if (status) 355 if (status)
@@ -424,7 +424,8 @@ void gpiochip_remove(struct gpio_chip *chip)
424 spin_unlock_irqrestore(&gpio_lock, flags); 424 spin_unlock_irqrestore(&gpio_lock, flags);
425 425
426 if (requested) 426 if (requested)
427 dev_crit(chip->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"); 427 dev_crit(chip->parent,
428 "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n");
428 429
429 kfree(chip->desc); 430 kfree(chip->desc);
430 chip->desc = NULL; 431 chip->desc = NULL;
@@ -683,11 +684,11 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
683 if (!gpiochip || !irqchip) 684 if (!gpiochip || !irqchip)
684 return -EINVAL; 685 return -EINVAL;
685 686
686 if (!gpiochip->dev) { 687 if (!gpiochip->parent) {
687 pr_err("missing gpiochip .dev parent pointer\n"); 688 pr_err("missing gpiochip .dev parent pointer\n");
688 return -EINVAL; 689 return -EINVAL;
689 } 690 }
690 of_node = gpiochip->dev->of_node; 691 of_node = gpiochip->parent->of_node;
691#ifdef CONFIG_OF_GPIO 692#ifdef CONFIG_OF_GPIO
692 /* 693 /*
693 * If the gpiochip has an assigned OF node this takes precedence 694 * If the gpiochip has an assigned OF node this takes precedence
@@ -2503,7 +2504,7 @@ static int gpiolib_seq_show(struct seq_file *s, void *v)
2503 2504
2504 seq_printf(s, "%sGPIOs %d-%d", (char *)s->private, 2505 seq_printf(s, "%sGPIOs %d-%d", (char *)s->private,
2505 chip->base, chip->base + chip->ngpio - 1); 2506 chip->base, chip->base + chip->ngpio - 1);
2506 dev = chip->dev; 2507 dev = chip->parent;
2507 if (dev) 2508 if (dev)
2508 seq_printf(s, ", %s/%s", dev->bus ? dev->bus->name : "no-bus", 2509 seq_printf(s, ", %s/%s", dev->bus ? dev->bus->name : "no-bus",
2509 dev_name(dev)); 2510 dev_name(dev));
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 7afc3fcc122c..f47954e8fd2c 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -1104,7 +1104,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
1104 dev->gc.base = -1; 1104 dev->gc.base = -1;
1105 dev->gc.ngpio = 8; 1105 dev->gc.ngpio = 8;
1106 dev->gc.can_sleep = 1; 1106 dev->gc.can_sleep = 1;
1107 dev->gc.dev = &hdev->dev; 1107 dev->gc.parent = &hdev->dev;
1108 1108
1109 ret = gpiochip_add(&dev->gc); 1109 ret = gpiochip_add(&dev->gc);
1110 if (ret < 0) { 1110 if (ret < 0) {
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index fec66ad80513..16b5cc2196f2 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
@@ -454,7 +454,7 @@ static int ad7879_gpio_add(struct ad7879 *ts,
454 ts->gc.ngpio = 1; 454 ts->gc.ngpio = 1;
455 ts->gc.label = "AD7879-GPIO"; 455 ts->gc.label = "AD7879-GPIO";
456 ts->gc.owner = THIS_MODULE; 456 ts->gc.owner = THIS_MODULE;
457 ts->gc.dev = ts->dev; 457 ts->gc.parent = ts->dev;
458 458
459 ret = gpiochip_add(&ts->gc); 459 ret = gpiochip_add(&ts->gc);
460 if (ret) 460 if (ret)
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 5a6363d161a2..a975b32ee8c8 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -319,7 +319,7 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
319 } 319 }
320 320
321#ifdef CONFIG_LEDS_PCA9532_GPIO 321#ifdef CONFIG_LEDS_PCA9532_GPIO
322 if (data->gpio.dev) 322 if (data->gpio.parent)
323 gpiochip_remove(&data->gpio); 323 gpiochip_remove(&data->gpio);
324#endif 324#endif
325 325
@@ -413,13 +413,13 @@ static int pca9532_configure(struct i2c_client *client,
413 data->gpio.can_sleep = 1; 413 data->gpio.can_sleep = 1;
414 data->gpio.base = pdata->gpio_base; 414 data->gpio.base = pdata->gpio_base;
415 data->gpio.ngpio = data->chip_info->num_leds; 415 data->gpio.ngpio = data->chip_info->num_leds;
416 data->gpio.dev = &client->dev; 416 data->gpio.parent = &client->dev;
417 data->gpio.owner = THIS_MODULE; 417 data->gpio.owner = THIS_MODULE;
418 418
419 err = gpiochip_add(&data->gpio); 419 err = gpiochip_add(&data->gpio);
420 if (err) { 420 if (err) {
421 /* Use data->gpio.dev as a flag for freeing gpiochip */ 421 /* Use data->gpio.dev as a flag for freeing gpiochip */
422 data->gpio.dev = NULL; 422 data->gpio.parent = NULL;
423 dev_warn(&client->dev, "could not add gpiochip\n"); 423 dev_warn(&client->dev, "could not add gpiochip\n");
424 } else { 424 } else {
425 dev_info(&client->dev, "gpios %i...%i\n", 425 dev_info(&client->dev, "gpios %i...%i\n",
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index edbecc4ca2da..75529a24a615 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -651,7 +651,7 @@ static int tca6507_probe_gpios(struct i2c_client *client,
651 tca->gpio.owner = THIS_MODULE; 651 tca->gpio.owner = THIS_MODULE;
652 tca->gpio.direction_output = tca6507_gpio_direction_output; 652 tca->gpio.direction_output = tca6507_gpio_direction_output;
653 tca->gpio.set = tca6507_gpio_set_value; 653 tca->gpio.set = tca6507_gpio_set_value;
654 tca->gpio.dev = &client->dev; 654 tca->gpio.parent = &client->dev;
655#ifdef CONFIG_OF_GPIO 655#ifdef CONFIG_OF_GPIO
656 tca->gpio.of_node = of_node_get(client->dev.of_node); 656 tca->gpio.of_node = of_node_get(client->dev.of_node);
657#endif 657#endif
diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c
index def6d21d1445..24a457d9d803 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -722,7 +722,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
722#ifdef CONFIG_GPIOLIB 722#ifdef CONFIG_GPIOLIB
723 /* add GPIOs */ 723 /* add GPIOs */
724 priv->gpio_chip.label = KBUILD_MODNAME; 724 priv->gpio_chip.label = KBUILD_MODNAME;
725 priv->gpio_chip.dev = &priv->i2c->dev; 725 priv->gpio_chip.parent = &priv->i2c->dev;
726 priv->gpio_chip.owner = THIS_MODULE; 726 priv->gpio_chip.owner = THIS_MODULE;
727 priv->gpio_chip.direction_output = 727 priv->gpio_chip.direction_output =
728 cxd2820r_gpio_direction_output; 728 cxd2820r_gpio_direction_output;
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)
259 int i; 259 int i;
260 260
261 /* GPIO-ish stuff */ 261 /* GPIO-ish stuff */
262 dm355evm_msp_gpio.dev = &client->dev; 262 dm355evm_msp_gpio.parent = &client->dev;
263 status = gpiochip_add(&dm355evm_msp_gpio); 263 status = gpiochip_add(&dm355evm_msp_gpio);
264 if (status < 0) 264 if (status < 0)
265 return status; 265 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)
321 ei->chip[i].dev = &(pdev->dev); 321 ei->chip[i].dev = &(pdev->dev);
322 chip = &(ei->chip[i].chip); 322 chip = &(ei->chip[i].chip);
323 chip->label = "htc-egpio"; 323 chip->label = "htc-egpio";
324 chip->dev = &pdev->dev; 324 chip->parent = &pdev->dev;
325 chip->owner = THIS_MODULE; 325 chip->owner = THIS_MODULE;
326 chip->get = egpio_get; 326 chip->get = egpio_get;
327 chip->set = egpio_set; 327 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(
429 /* Setup the GPIO chips */ 429 /* Setup the GPIO chips */
430 gpio_chip = &(chip->chip_out); 430 gpio_chip = &(chip->chip_out);
431 gpio_chip->label = "htcpld-out"; 431 gpio_chip->label = "htcpld-out";
432 gpio_chip->dev = dev; 432 gpio_chip->parent = dev;
433 gpio_chip->owner = THIS_MODULE; 433 gpio_chip->owner = THIS_MODULE;
434 gpio_chip->get = htcpld_chip_get; 434 gpio_chip->get = htcpld_chip_get;
435 gpio_chip->set = htcpld_chip_set; 435 gpio_chip->set = htcpld_chip_set;
@@ -440,7 +440,7 @@ static int htcpld_register_chip_gpio(
440 440
441 gpio_chip = &(chip->chip_in); 441 gpio_chip = &(chip->chip_in);
442 gpio_chip->label = "htcpld-in"; 442 gpio_chip->label = "htcpld-in";
443 gpio_chip->dev = dev; 443 gpio_chip->parent = dev;
444 gpio_chip->owner = THIS_MODULE; 444 gpio_chip->owner = THIS_MODULE;
445 gpio_chip->get = htcpld_chip_get; 445 gpio_chip->get = htcpld_chip_get;
446 gpio_chip->set = NULL; 446 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,
638 tps->outmask = board->outmask; 638 tps->outmask = board->outmask;
639 639
640 tps->chip.label = client->name; 640 tps->chip.label = client->name;
641 tps->chip.dev = &client->dev; 641 tps->chip.parent = &client->dev;
642 tps->chip.owner = THIS_MODULE; 642 tps->chip.owner = THIS_MODULE;
643 643
644 tps->chip.set = tps65010_gpio_set; 644 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)
570 570
571 if (pdata && pdata->gpio_base) { 571 if (pdata && pdata->gpio_base) {
572 ucb->gpio.label = dev_name(&ucb->dev); 572 ucb->gpio.label = dev_name(&ucb->dev);
573 ucb->gpio.dev = &ucb->dev; 573 ucb->gpio.parent = &ucb->dev;
574 ucb->gpio.owner = THIS_MODULE; 574 ucb->gpio.owner = THIS_MODULE;
575 ucb->gpio.base = pdata->gpio_base; 575 ucb->gpio.base = pdata->gpio_base;
576 ucb->gpio.ngpio = 10; 576 ucb->gpio.ngpio = 10;
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index a1ea565fcd46..0bc1abcedbae 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -337,7 +337,7 @@ static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
337 337
338static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) 338static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
339{ 339{
340 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); 340 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent);
341 341
342 return bcm2835_gpio_get_bit(pc, GPLEV0, offset); 342 return bcm2835_gpio_get_bit(pc, GPLEV0, offset);
343} 343}
@@ -350,14 +350,14 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
350 350
351static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 351static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
352{ 352{
353 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); 353 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent);
354 354
355 bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); 355 bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
356} 356}
357 357
358static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 358static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
359{ 359{
360 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); 360 struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent);
361 361
362 return irq_linear_revmap(pc->irq_domain, offset); 362 return irq_linear_revmap(pc->irq_domain, offset);
363} 363}
@@ -963,7 +963,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
963 return PTR_ERR(pc->base); 963 return PTR_ERR(pc->base);
964 964
965 pc->gpio_chip = bcm2835_gpio_chip; 965 pc->gpio_chip = bcm2835_gpio_chip;
966 pc->gpio_chip.dev = dev; 966 pc->gpio_chip.parent = dev;
967 pc->gpio_chip.of_node = np; 967 pc->gpio_chip.of_node = np;
968 968
969 pc->irq_domain = irq_domain_add_linear(np, BCM2835_NUM_GPIOS, 969 pc->irq_domain = irq_domain_add_linear(np, BCM2835_NUM_GPIOS,
diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c b/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c
index 12a48f498b75..bd212b269094 100644
--- a/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c
@@ -720,7 +720,7 @@ static int cygnus_gpio_probe(struct platform_device *pdev)
720 gc->ngpio = ngpios; 720 gc->ngpio = ngpios;
721 chip->num_banks = (ngpios + NGPIOS_PER_BANK - 1) / NGPIOS_PER_BANK; 721 chip->num_banks = (ngpios + NGPIOS_PER_BANK - 1) / NGPIOS_PER_BANK;
722 gc->label = dev_name(dev); 722 gc->label = dev_name(dev);
723 gc->dev = dev; 723 gc->parent = dev;
724 gc->of_node = dev->of_node; 724 gc->of_node = dev->of_node;
725 gc->request = cygnus_gpio_request; 725 gc->request = cygnus_gpio_request;
726 gc->free = cygnus_gpio_free; 726 gc->free = cygnus_gpio_free;
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
index b59ce75b1947..bb92f8ae6b33 100644
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -598,7 +598,7 @@ static int byt_gpio_probe(struct platform_device *pdev)
598 gc->dbg_show = byt_gpio_dbg_show; 598 gc->dbg_show = byt_gpio_dbg_show;
599 gc->base = -1; 599 gc->base = -1;
600 gc->can_sleep = false; 600 gc->can_sleep = false;
601 gc->dev = dev; 601 gc->parent = dev;
602 602
603#ifdef CONFIG_PM_SLEEP 603#ifdef CONFIG_PM_SLEEP
604 vg->saved_context = devm_kcalloc(&pdev->dev, gc->ngpio, 604 vg->saved_context = devm_kcalloc(&pdev->dev, gc->ngpio,
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index 84936bae6e5e..dac8ec46aeb4 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1436,7 +1436,7 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
1436 1436
1437 chip->ngpio = pctrl->community->ngpios; 1437 chip->ngpio = pctrl->community->ngpios;
1438 chip->label = dev_name(pctrl->dev); 1438 chip->label = dev_name(pctrl->dev);
1439 chip->dev = pctrl->dev; 1439 chip->parent = pctrl->dev;
1440 chip->base = -1; 1440 chip->base = -1;
1441 1441
1442 ret = gpiochip_add(chip); 1442 ret = gpiochip_add(chip);
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 392e28d3f48d..401c186244be 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -874,7 +874,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
874 874
875 pctrl->chip.ngpio = pctrl->soc->npins; 875 pctrl->chip.ngpio = pctrl->soc->npins;
876 pctrl->chip.label = dev_name(pctrl->dev); 876 pctrl->chip.label = dev_name(pctrl->dev);
877 pctrl->chip.dev = pctrl->dev; 877 pctrl->chip.parent = pctrl->dev;
878 pctrl->chip.base = -1; 878 pctrl->chip.base = -1;
879 879
880 ret = gpiochip_add(&pctrl->chip); 880 ret = gpiochip_add(&pctrl->chip);
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index f307f1d27d64..a71f68362967 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -95,7 +95,7 @@ static void mtk_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
95{ 95{
96 unsigned int reg_addr; 96 unsigned int reg_addr;
97 unsigned int bit; 97 unsigned int bit;
98 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); 98 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
99 99
100 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dout_offset; 100 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dout_offset;
101 bit = BIT(offset & 0xf); 101 bit = BIT(offset & 0xf);
@@ -742,7 +742,7 @@ static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
742 unsigned int bit; 742 unsigned int bit;
743 unsigned int read_val = 0; 743 unsigned int read_val = 0;
744 744
745 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); 745 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
746 746
747 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; 747 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset;
748 bit = BIT(offset & 0xf); 748 bit = BIT(offset & 0xf);
@@ -755,7 +755,7 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
755 unsigned int reg_addr; 755 unsigned int reg_addr;
756 unsigned int bit; 756 unsigned int bit;
757 unsigned int read_val = 0; 757 unsigned int read_val = 0;
758 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); 758 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
759 759
760 if (mtk_gpio_get_direction(chip, offset)) 760 if (mtk_gpio_get_direction(chip, offset))
761 reg_addr = mtk_get_port(pctl, offset) + 761 reg_addr = mtk_get_port(pctl, offset) +
@@ -772,7 +772,7 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
772static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 772static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
773{ 773{
774 const struct mtk_desc_pin *pin; 774 const struct mtk_desc_pin *pin;
775 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); 775 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
776 int irq; 776 int irq;
777 777
778 pin = pctl->devdata->pins + offset; 778 pin = pctl->devdata->pins + offset;
@@ -940,7 +940,7 @@ static void mtk_eint_unmask(struct irq_data *d)
940static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, 940static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
941 unsigned debounce) 941 unsigned debounce)
942{ 942{
943 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev); 943 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
944 int eint_num, virq, eint_offset; 944 int eint_num, virq, eint_offset;
945 unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc; 945 unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
946 static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256}; 946 static const unsigned int dbnc_arr[] = {0 , 1, 16, 32, 64, 128, 256};
@@ -1348,7 +1348,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
1348 *pctl->chip = mtk_gpio_chip; 1348 *pctl->chip = mtk_gpio_chip;
1349 pctl->chip->ngpio = pctl->devdata->npins; 1349 pctl->chip->ngpio = pctl->devdata->npins;
1350 pctl->chip->label = dev_name(&pdev->dev); 1350 pctl->chip->label = dev_name(&pdev->dev);
1351 pctl->chip->dev = &pdev->dev; 1351 pctl->chip->parent = &pdev->dev;
1352 pctl->chip->base = -1; 1352 pctl->chip->base = -1;
1353 1353
1354 ret = gpiochip_add(pctl->chip); 1354 ret = gpiochip_add(pctl->chip);
diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 84943e4cff09..4b5f6829144d 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -562,7 +562,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
562 domain = &pc->domains[i]; 562 domain = &pc->domains[i];
563 563
564 domain->chip.label = domain->data->name; 564 domain->chip.label = domain->data->name;
565 domain->chip.dev = pc->dev; 565 domain->chip.parent = pc->dev;
566 domain->chip.request = meson_gpio_request; 566 domain->chip.request = meson_gpio_request;
567 domain->chip.free = meson_gpio_free; 567 domain->chip.free = meson_gpio_free;
568 domain->chip.direction_input = meson_gpio_direction_input; 568 domain->chip.direction_input = meson_gpio_direction_input;
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index b59fbb4b1fb1..434d5de0177b 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -986,7 +986,7 @@ static int abx500_pin_config_set(struct pinctrl_dev *pctldev,
986 param = pinconf_to_config_param(configs[i]); 986 param = pinconf_to_config_param(configs[i]);
987 argument = pinconf_to_config_argument(configs[i]); 987 argument = pinconf_to_config_argument(configs[i]);
988 988
989 dev_dbg(chip->dev, "pin %d [%#lx]: %s %s\n", 989 dev_dbg(chip->parent, "pin %d [%#lx]: %s %s\n",
990 pin, configs[i], 990 pin, configs[i],
991 (param == PIN_CONFIG_OUTPUT) ? "output " : "input", 991 (param == PIN_CONFIG_OUTPUT) ? "output " : "input",
992 (param == PIN_CONFIG_OUTPUT) ? 992 (param == PIN_CONFIG_OUTPUT) ?
@@ -1077,7 +1077,8 @@ static int abx500_pin_config_set(struct pinctrl_dev *pctldev,
1077 break; 1077 break;
1078 1078
1079 default: 1079 default:
1080 dev_err(chip->dev, "illegal configuration requested\n"); 1080 dev_err(chip->parent,
1081 "illegal configuration requested\n");
1081 } 1082 }
1082 } /* for each config */ 1083 } /* for each config */
1083out: 1084out:
@@ -1172,7 +1173,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
1172 pct->dev = &pdev->dev; 1173 pct->dev = &pdev->dev;
1173 pct->parent = dev_get_drvdata(pdev->dev.parent); 1174 pct->parent = dev_get_drvdata(pdev->dev.parent);
1174 pct->chip = abx500gpio_chip; 1175 pct->chip = abx500gpio_chip;
1175 pct->chip.dev = &pdev->dev; 1176 pct->chip.parent = &pdev->dev;
1176 pct->chip.base = -1; /* Dynamic allocation */ 1177 pct->chip.base = -1; /* Dynamic allocation */
1177 1178
1178 match = of_match_device(abx500_gpio_match, &pdev->dev); 1179 match = of_match_device(abx500_gpio_match, &pdev->dev);
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index eebfae0c9b7c..cb4a327425a0 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -438,7 +438,7 @@ nmk_gpio_disable_lazy_irq(struct nmk_gpio_chip *nmk_chip, unsigned offset)
438 nmk_chip->addr + NMK_GPIO_FIMSC); 438 nmk_chip->addr + NMK_GPIO_FIMSC);
439 } 439 }
440 440
441 dev_dbg(nmk_chip->chip.dev, "%d: clearing interrupt mask\n", gpio); 441 dev_dbg(nmk_chip->chip.parent, "%d: clearing interrupt mask\n", gpio);
442} 442}
443 443
444static void nmk_write_masked(void __iomem *reg, u32 mask, u32 value) 444static void nmk_write_masked(void __iomem *reg, u32 mask, u32 value)
@@ -1188,7 +1188,7 @@ static struct nmk_gpio_chip *nmk_gpio_populate_chip(struct device_node *np,
1188 chip->base = id * NMK_GPIO_PER_CHIP; 1188 chip->base = id * NMK_GPIO_PER_CHIP;
1189 chip->ngpio = NMK_GPIO_PER_CHIP; 1189 chip->ngpio = NMK_GPIO_PER_CHIP;
1190 chip->label = dev_name(&gpio_pdev->dev); 1190 chip->label = dev_name(&gpio_pdev->dev);
1191 chip->dev = &gpio_pdev->dev; 1191 chip->parent = &gpio_pdev->dev;
1192 1192
1193 res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0); 1193 res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0);
1194 base = devm_ioremap_resource(&pdev->dev, res); 1194 base = devm_ioremap_resource(&pdev->dev, res);
@@ -1890,7 +1890,7 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
1890 if (slpm_val) 1890 if (slpm_val)
1891 val = slpm_val - 1; 1891 val = slpm_val - 1;
1892 1892
1893 dev_dbg(nmk_chip->chip.dev, 1893 dev_dbg(nmk_chip->chip.parent,
1894 "pin %d: sleep pull %s, dir %s, val %s\n", 1894 "pin %d: sleep pull %s, dir %s, val %s\n",
1895 pin, 1895 pin,
1896 slpm_pull ? pullnames[pull] : "same", 1896 slpm_pull ? pullnames[pull] : "same",
@@ -1899,7 +1899,7 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
1899 slpm_val ? (val ? "high" : "low") : "same"); 1899 slpm_val ? (val ? "high" : "low") : "same");
1900 } 1900 }
1901 1901
1902 dev_dbg(nmk_chip->chip.dev, 1902 dev_dbg(nmk_chip->chip.parent,
1903 "pin %d [%#lx]: pull %s, slpm %s (%s%s), lowemi %s\n", 1903 "pin %d [%#lx]: pull %s, slpm %s (%s%s), lowemi %s\n",
1904 pin, cfg, pullnames[pull], slpmnames[slpm], 1904 pin, cfg, pullnames[pull], slpmnames[slpm],
1905 output ? "output " : "input", 1905 output ? "output " : "input",
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 3318f1d6193c..a74b2b0a75e0 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -778,7 +778,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
778 gpio_dev->gc.base = 0; 778 gpio_dev->gc.base = 0;
779 gpio_dev->gc.label = pdev->name; 779 gpio_dev->gc.label = pdev->name;
780 gpio_dev->gc.owner = THIS_MODULE; 780 gpio_dev->gc.owner = THIS_MODULE;
781 gpio_dev->gc.dev = &pdev->dev; 781 gpio_dev->gc.parent = &pdev->dev;
782 gpio_dev->gc.ngpio = TOTAL_NUMBER_OF_PINS; 782 gpio_dev->gc.ngpio = TOTAL_NUMBER_OF_PINS;
783#if defined(CONFIG_OF_GPIO) 783#if defined(CONFIG_OF_GPIO)
784 gpio_dev->gc.of_node = pdev->dev.of_node; 784 gpio_dev->gc.of_node = pdev->dev.of_node;
diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c
index 56af28b95a44..89479bea6262 100644
--- a/drivers/pinctrl/pinctrl-as3722.c
+++ b/drivers/pinctrl/pinctrl-as3722.c
@@ -582,7 +582,7 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
582 } 582 }
583 583
584 as_pci->gpio_chip = as3722_gpio_chip; 584 as_pci->gpio_chip = as3722_gpio_chip;
585 as_pci->gpio_chip.dev = &pdev->dev; 585 as_pci->gpio_chip.parent = &pdev->dev;
586 as_pci->gpio_chip.of_node = pdev->dev.parent->of_node; 586 as_pci->gpio_chip.of_node = pdev->dev.parent->of_node;
587 ret = gpiochip_add(&as_pci->gpio_chip); 587 ret = gpiochip_add(&as_pci->gpio_chip);
588 if (ret < 0) { 588 if (ret < 0) {
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index 33edd07d9149..f1daf8580167 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -290,7 +290,7 @@ static void atmel_gpio_irq_handler(struct irq_desc *desc)
290 290
291static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 291static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
292{ 292{
293 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev); 293 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
294 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 294 struct atmel_pin *pin = atmel_pioctrl->pins[offset];
295 unsigned reg; 295 unsigned reg;
296 296
@@ -305,7 +305,7 @@ static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
305 305
306static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset) 306static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset)
307{ 307{
308 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev); 308 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
309 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 309 struct atmel_pin *pin = atmel_pioctrl->pins[offset];
310 unsigned reg; 310 unsigned reg;
311 311
@@ -317,7 +317,7 @@ static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset)
317static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset, 317static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
318 int value) 318 int value)
319{ 319{
320 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev); 320 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
321 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 321 struct atmel_pin *pin = atmel_pioctrl->pins[offset];
322 unsigned reg; 322 unsigned reg;
323 323
@@ -336,7 +336,7 @@ static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
336 336
337static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val) 337static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
338{ 338{
339 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev); 339 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
340 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 340 struct atmel_pin *pin = atmel_pioctrl->pins[offset];
341 341
342 atmel_gpio_write(atmel_pioctrl, pin->bank, 342 atmel_gpio_write(atmel_pioctrl, pin->bank,
@@ -346,7 +346,7 @@ static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
346 346
347static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 347static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
348{ 348{
349 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev); 349 struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
350 350
351 return irq_find_mapping(atmel_pioctrl->irq_domain, offset); 351 return irq_find_mapping(atmel_pioctrl->irq_domain, offset);
352} 352}
@@ -969,7 +969,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
969 atmel_pioctrl->gpio_chip->of_node = dev->of_node; 969 atmel_pioctrl->gpio_chip->of_node = dev->of_node;
970 atmel_pioctrl->gpio_chip->ngpio = atmel_pioctrl->npins; 970 atmel_pioctrl->gpio_chip->ngpio = atmel_pioctrl->npins;
971 atmel_pioctrl->gpio_chip->label = dev_name(dev); 971 atmel_pioctrl->gpio_chip->label = dev_name(dev);
972 atmel_pioctrl->gpio_chip->dev = dev; 972 atmel_pioctrl->gpio_chip->parent = dev;
973 atmel_pioctrl->gpio_chip->names = atmel_pioctrl->group_names; 973 atmel_pioctrl->gpio_chip->names = atmel_pioctrl->group_names;
974 974
975 atmel_pioctrl->pm_wakeup_sources = devm_kzalloc(dev, 975 atmel_pioctrl->pm_wakeup_sources = devm_kzalloc(dev,
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 0d2fc0cff35e..667d90607abc 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1750,7 +1750,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
1750 chip = &at91_chip->chip; 1750 chip = &at91_chip->chip;
1751 chip->of_node = np; 1751 chip->of_node = np;
1752 chip->label = dev_name(&pdev->dev); 1752 chip->label = dev_name(&pdev->dev);
1753 chip->dev = &pdev->dev; 1753 chip->parent = &pdev->dev;
1754 chip->owner = THIS_MODULE; 1754 chip->owner = THIS_MODULE;
1755 chip->base = alias_idx * MAX_NB_GPIO_PER_BANK; 1755 chip->base = alias_idx * MAX_NB_GPIO_PER_BANK;
1756 1756
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index 813eb7c771ec..e1cbf56df4b2 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -637,7 +637,7 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
637 637
638 gpio->chip = u300_gpio_chip; 638 gpio->chip = u300_gpio_chip;
639 gpio->chip.ngpio = U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT; 639 gpio->chip.ngpio = U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT;
640 gpio->chip.dev = &pdev->dev; 640 gpio->chip.parent = &pdev->dev;
641 gpio->chip.base = 0; 641 gpio->chip.base = 0;
642 gpio->dev = &pdev->dev; 642 gpio->dev = &pdev->dev;
643 643
diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
index 38a7799f8257..d8efb2ccac6c 100644
--- a/drivers/pinctrl/pinctrl-digicolor.c
+++ b/drivers/pinctrl/pinctrl-digicolor.c
@@ -244,7 +244,7 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np)
244 int ret; 244 int ret;
245 245
246 chip->label = DRIVER_NAME; 246 chip->label = DRIVER_NAME;
247 chip->dev = pmap->dev; 247 chip->parent = pmap->dev;
248 chip->request = gpiochip_generic_request; 248 chip->request = gpiochip_generic_request;
249 chip->free = gpiochip_generic_free; 249 chip->free = gpiochip_generic_free;
250 chip->direction_input = dc_gpio_direction_input; 250 chip->direction_input = dc_gpio_direction_input;
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
index 85c9046c690e..fd5148d106a3 100644
--- a/drivers/pinctrl/pinctrl-pistachio.c
+++ b/drivers/pinctrl/pinctrl-pistachio.c
@@ -1388,7 +1388,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
1388 bank->pctl = pctl; 1388 bank->pctl = pctl;
1389 bank->base = pctl->base + GPIO_BANK_BASE(i); 1389 bank->base = pctl->base + GPIO_BANK_BASE(i);
1390 1390
1391 bank->gpio_chip.dev = pctl->dev; 1391 bank->gpio_chip.parent = pctl->dev;
1392 bank->gpio_chip.of_node = child; 1392 bank->gpio_chip.of_node = child;
1393 ret = gpiochip_add(&bank->gpio_chip); 1393 ret = gpiochip_add(&bank->gpio_chip);
1394 if (ret < 0) { 1394 if (ret < 0) {
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index a0651128e23a..2b88a40f61d3 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -1754,7 +1754,7 @@ static int rockchip_gpiolib_register(struct platform_device *pdev,
1754 gc = &bank->gpio_chip; 1754 gc = &bank->gpio_chip;
1755 gc->base = bank->pin_base; 1755 gc->base = bank->pin_base;
1756 gc->ngpio = bank->nr_pins; 1756 gc->ngpio = bank->nr_pins;
1757 gc->dev = &pdev->dev; 1757 gc->parent = &pdev->dev;
1758 gc->of_node = bank->of_node; 1758 gc->of_node = bank->of_node;
1759 gc->label = bank->name; 1759 gc->label = bank->name;
1760 1760
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index b58d3f29148a..52639e65ea67 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1522,7 +1522,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
1522 bank->gpio_chip.base = bank_num * ST_GPIO_PINS_PER_BANK; 1522 bank->gpio_chip.base = bank_num * ST_GPIO_PINS_PER_BANK;
1523 bank->gpio_chip.ngpio = ST_GPIO_PINS_PER_BANK; 1523 bank->gpio_chip.ngpio = ST_GPIO_PINS_PER_BANK;
1524 bank->gpio_chip.of_node = np; 1524 bank->gpio_chip.of_node = np;
1525 bank->gpio_chip.dev = dev; 1525 bank->gpio_chip.parent = dev;
1526 spin_lock_init(&bank->lock); 1526 spin_lock_init(&bank->lock);
1527 1527
1528 of_property_read_string(np, "st,bank-name", &range->name); 1528 of_property_read_string(np, "st,bank-name", &range->name);
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index ae724bdab3d3..b4380fb72001 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -648,7 +648,7 @@ static struct ltq_pinmux_info xway_info = {
648/* --------- gpio_chip related code --------- */ 648/* --------- gpio_chip related code --------- */
649static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val) 649static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
650{ 650{
651 struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); 651 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
652 652
653 if (val) 653 if (val)
654 gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin)); 654 gpio_setbit(info->membase[0], GPIO_OUT(pin), PORT_PIN(pin));
@@ -658,14 +658,14 @@ static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
658 658
659static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin) 659static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin)
660{ 660{
661 struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); 661 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
662 662
663 return gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin)); 663 return gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin));
664} 664}
665 665
666static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin) 666static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin)
667{ 667{
668 struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); 668 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
669 669
670 gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); 670 gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
671 671
@@ -674,7 +674,7 @@ static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin)
674 674
675static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val) 675static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
676{ 676{
677 struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev); 677 struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
678 678
679 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin)); 679 gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
680 xway_gpio_set(chip, pin, val); 680 xway_gpio_set(chip, pin, val);
@@ -783,7 +783,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
783 xway_pctrl_desc.pins = xway_info.pads; 783 xway_pctrl_desc.pins = xway_info.pads;
784 784
785 /* load the gpio chip */ 785 /* load the gpio chip */
786 xway_chip.dev = &pdev->dev; 786 xway_chip.parent = &pdev->dev;
787 ret = gpiochip_add(&xway_chip); 787 ret = gpiochip_add(&xway_chip);
788 if (ret) { 788 if (ret) {
789 dev_err(&pdev->dev, "Failed to register gpio chip\n"); 789 dev_err(&pdev->dev, "Failed to register gpio chip\n");
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 146264a41ec8..af2a13040898 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -800,7 +800,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
800 chip->base = 0; 800 chip->base = 0;
801 chip->ngpio = ngpio; 801 chip->ngpio = ngpio;
802 chip->label = dev_name(pctrl->dev); 802 chip->label = dev_name(pctrl->dev);
803 chip->dev = pctrl->dev; 803 chip->parent = pctrl->dev;
804 chip->owner = THIS_MODULE; 804 chip->owner = THIS_MODULE;
805 chip->of_node = pctrl->dev->of_node; 805 chip->of_node = pctrl->dev->of_node;
806 806
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index 6c42ca14d2fd..3e5ccc76d59c 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -760,7 +760,7 @@ static int pmic_gpio_probe(struct platform_device *pdev)
760 } 760 }
761 761
762 state->chip = pmic_gpio_gpio_template; 762 state->chip = pmic_gpio_gpio_template;
763 state->chip.dev = dev; 763 state->chip.parent = dev;
764 state->chip.base = -1; 764 state->chip.base = -1;
765 state->chip.ngpio = npins; 765 state->chip.ngpio = npins;
766 state->chip.label = dev_name(dev); 766 state->chip.label = dev_name(dev);
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 9ce0e30e33e8..69c14ba177d0 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -862,7 +862,7 @@ static int pmic_mpp_probe(struct platform_device *pdev)
862 } 862 }
863 863
864 state->chip = pmic_mpp_gpio_template; 864 state->chip = pmic_mpp_gpio_template;
865 state->chip.dev = dev; 865 state->chip.parent = dev;
866 state->chip.base = -1; 866 state->chip.base = -1;
867 state->chip.ngpio = npins; 867 state->chip.ngpio = npins;
868 state->chip.label = dev_name(dev); 868 state->chip.label = dev_name(dev);
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index d809c9eaa323..7b80fa9c2049 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -730,7 +730,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
730 730
731 pctrl->chip = pm8xxx_gpio_template; 731 pctrl->chip = pm8xxx_gpio_template;
732 pctrl->chip.base = -1; 732 pctrl->chip.base = -1;
733 pctrl->chip.dev = &pdev->dev; 733 pctrl->chip.parent = &pdev->dev;
734 pctrl->chip.of_node = pdev->dev.of_node; 734 pctrl->chip.of_node = pdev->dev.of_node;
735 pctrl->chip.of_gpio_n_cells = 2; 735 pctrl->chip.of_gpio_n_cells = 2;
736 pctrl->chip.label = dev_name(pctrl->dev); 736 pctrl->chip.label = dev_name(pctrl->dev);
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
index 8982027de8e8..7bc1e0f27447 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
@@ -821,7 +821,7 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
821 821
822 pctrl->chip = pm8xxx_mpp_template; 822 pctrl->chip = pm8xxx_mpp_template;
823 pctrl->chip.base = -1; 823 pctrl->chip.base = -1;
824 pctrl->chip.dev = &pdev->dev; 824 pctrl->chip.parent = &pdev->dev;
825 pctrl->chip.of_node = pdev->dev.of_node; 825 pctrl->chip.of_node = pdev->dev.of_node;
826 pctrl->chip.of_gpio_n_cells = 2; 826 pctrl->chip.of_gpio_n_cells = 2;
827 pctrl->chip.label = dev_name(pctrl->dev); 827 pctrl->chip.label = dev_name(pctrl->dev);
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 71ccf6a90b22..7d7374e57f16 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -176,7 +176,8 @@ static int exynos_irq_request_resources(struct irq_data *irqd)
176 176
177 ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq); 177 ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq);
178 if (ret) { 178 if (ret) {
179 dev_err(bank->gpio_chip.dev, "unable to lock pin %s-%lu IRQ\n", 179 dev_err(bank->gpio_chip.parent,
180 "unable to lock pin %s-%lu IRQ\n",
180 bank->name, irqd->hwirq); 181 bank->name, irqd->hwirq);
181 return ret; 182 return ret;
182 } 183 }
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
index 82dc109f7ed4..f61f9a6fa9af 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
@@ -539,7 +539,7 @@ static const struct pinconf_ops exynos5440_pinconf_ops = {
539/* gpiolib gpio_set callback function */ 539/* gpiolib gpio_set callback function */
540static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value) 540static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
541{ 541{
542 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev); 542 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
543 void __iomem *base = priv->reg_base; 543 void __iomem *base = priv->reg_base;
544 u32 data; 544 u32 data;
545 545
@@ -553,7 +553,7 @@ static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value
553/* gpiolib gpio_get callback function */ 553/* gpiolib gpio_get callback function */
554static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset) 554static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset)
555{ 555{
556 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev); 556 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
557 void __iomem *base = priv->reg_base; 557 void __iomem *base = priv->reg_base;
558 u32 data; 558 u32 data;
559 559
@@ -566,7 +566,7 @@ static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset)
566/* gpiolib gpio_direction_input callback function */ 566/* gpiolib gpio_direction_input callback function */
567static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset) 567static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
568{ 568{
569 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev); 569 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
570 void __iomem *base = priv->reg_base; 570 void __iomem *base = priv->reg_base;
571 u32 data; 571 u32 data;
572 572
@@ -586,7 +586,7 @@ static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset
586static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset, 586static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
587 int value) 587 int value)
588{ 588{
589 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev); 589 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
590 void __iomem *base = priv->reg_base; 590 void __iomem *base = priv->reg_base;
591 u32 data; 591 u32 data;
592 592
@@ -607,7 +607,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse
607/* gpiolib gpio_to_irq callback function */ 607/* gpiolib gpio_to_irq callback function */
608static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset) 608static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
609{ 609{
610 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev); 610 struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
611 unsigned int virq; 611 unsigned int virq;
612 612
613 if (offset < 16 || offset > 23) 613 if (offset < 16 || offset > 23)
@@ -817,7 +817,7 @@ static int exynos5440_gpiolib_register(struct platform_device *pdev,
817 priv->gc = gc; 817 priv->gc = gc;
818 gc->base = 0; 818 gc->base = 0;
819 gc->ngpio = EXYNOS5440_MAX_PINS; 819 gc->ngpio = EXYNOS5440_MAX_PINS;
820 gc->dev = &pdev->dev; 820 gc->parent = &pdev->dev;
821 gc->set = exynos5440_gpio_set; 821 gc->set = exynos5440_gpio_set;
822 gc->get = exynos5440_gpio_get; 822 gc->get = exynos5440_gpio_get;
823 gc->direction_input = exynos5440_gpio_direction_input; 823 gc->direction_input = exynos5440_gpio_direction_input;
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index 3f622ccd8eab..bb4db2050f19 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -914,7 +914,7 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
914 gc = &bank->gpio_chip; 914 gc = &bank->gpio_chip;
915 gc->base = drvdata->pin_base + bank->pin_base; 915 gc->base = drvdata->pin_base + bank->pin_base;
916 gc->ngpio = bank->nr_pins; 916 gc->ngpio = bank->nr_pins;
917 gc->dev = &pdev->dev; 917 gc->parent = &pdev->dev;
918 gc->of_node = bank->of_node; 918 gc->of_node = bank->of_node;
919 gc->label = bank->name; 919 gc->label = bank->name;
920 920
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c
index db3f09aa8993..cdb2460a7b00 100644
--- a/drivers/pinctrl/sh-pfc/gpio.c
+++ b/drivers/pinctrl/sh-pfc/gpio.c
@@ -246,7 +246,7 @@ static int gpio_pin_setup(struct sh_pfc_chip *chip)
246 gc->to_irq = gpio_pin_to_irq; 246 gc->to_irq = gpio_pin_to_irq;
247 247
248 gc->label = pfc->info->name; 248 gc->label = pfc->info->name;
249 gc->dev = pfc->dev; 249 gc->parent = pfc->dev;
250 gc->owner = THIS_MODULE; 250 gc->owner = THIS_MODULE;
251 gc->base = 0; 251 gc->base = 0;
252 gc->ngpio = pfc->nr_gpio_pins; 252 gc->ngpio = pfc->nr_gpio_pins;
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c
index 829018c812bd..1850dc1b3863 100644
--- a/drivers/pinctrl/sirf/pinctrl-atlas7.c
+++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c
@@ -6012,7 +6012,7 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
6012 chip->label = kstrdup(np->name, GFP_KERNEL); 6012 chip->label = kstrdup(np->name, GFP_KERNEL);
6013 chip->of_node = np; 6013 chip->of_node = np;
6014 chip->of_gpio_n_cells = 2; 6014 chip->of_gpio_n_cells = 2;
6015 chip->dev = &pdev->dev; 6015 chip->parent = &pdev->dev;
6016 6016
6017 /* Add gpio chip to system */ 6017 /* Add gpio chip to system */
6018 ret = gpiochip_add(chip); 6018 ret = gpiochip_add(chip);
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 2a8d69725de8..ae97bdc75a69 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -811,7 +811,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
811 sgpio->chip.gc.of_node = np; 811 sgpio->chip.gc.of_node = np;
812 sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate; 812 sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate;
813 sgpio->chip.gc.of_gpio_n_cells = 2; 813 sgpio->chip.gc.of_gpio_n_cells = 2;
814 sgpio->chip.gc.dev = &pdev->dev; 814 sgpio->chip.gc.parent = &pdev->dev;
815 sgpio->chip.regs = regs; 815 sgpio->chip.regs = regs;
816 816
817 err = gpiochip_add(&sgpio->chip.gc); 817 err = gpiochip_add(&sgpio->chip.gc);
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 1f0af250dbb5..925f597de266 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -561,7 +561,7 @@ static int plgpio_probe(struct platform_device *pdev)
561 plgpio->chip.get = plgpio_get_value; 561 plgpio->chip.get = plgpio_get_value;
562 plgpio->chip.set = plgpio_set_value; 562 plgpio->chip.set = plgpio_set_value;
563 plgpio->chip.label = dev_name(&pdev->dev); 563 plgpio->chip.label = dev_name(&pdev->dev);
564 plgpio->chip.dev = &pdev->dev; 564 plgpio->chip.parent = &pdev->dev;
565 plgpio->chip.owner = THIS_MODULE; 565 plgpio->chip.owner = THIS_MODULE;
566 plgpio->chip.of_node = pdev->dev.of_node; 566 plgpio->chip.of_node = pdev->dev.of_node;
567 567
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index dead97daca35..a437e4f8628b 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -454,7 +454,7 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
454 454
455static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset) 455static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
456{ 456{
457 struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev); 457 struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent);
458 u32 reg = sunxi_data_reg(offset); 458 u32 reg = sunxi_data_reg(offset);
459 u8 index = sunxi_data_offset(offset); 459 u8 index = sunxi_data_offset(offset);
460 u32 set_mux = pctl->desc->irq_read_needs_mux && 460 u32 set_mux = pctl->desc->irq_read_needs_mux &&
@@ -475,7 +475,7 @@ static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
475static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip, 475static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
476 unsigned offset, int value) 476 unsigned offset, int value)
477{ 477{
478 struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev); 478 struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent);
479 u32 reg = sunxi_data_reg(offset); 479 u32 reg = sunxi_data_reg(offset);
480 u8 index = sunxi_data_offset(offset); 480 u8 index = sunxi_data_offset(offset);
481 unsigned long flags; 481 unsigned long flags;
@@ -522,7 +522,7 @@ static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
522 522
523static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 523static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
524{ 524{
525 struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev); 525 struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent);
526 struct sunxi_desc_function *desc; 526 struct sunxi_desc_function *desc;
527 unsigned pinnum = pctl->desc->pin_base + offset; 527 unsigned pinnum = pctl->desc->pin_base + offset;
528 unsigned irqnum; 528 unsigned irqnum;
@@ -536,7 +536,7 @@ static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
536 536
537 irqnum = desc->irqbank * IRQ_PER_BANK + desc->irqnum; 537 irqnum = desc->irqbank * IRQ_PER_BANK + desc->irqnum;
538 538
539 dev_dbg(chip->dev, "%s: request IRQ for GPIO %d, return %d\n", 539 dev_dbg(chip->parent, "%s: request IRQ for GPIO %d, return %d\n",
540 chip->label, offset + chip->base, irqnum); 540 chip->label, offset + chip->base, irqnum);
541 541
542 return irq_find_mapping(pctl->domain, irqnum); 542 return irq_find_mapping(pctl->domain, irqnum);
@@ -959,7 +959,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
959 pctl->chip->ngpio = round_up(last_pin, PINS_PER_BANK) - 959 pctl->chip->ngpio = round_up(last_pin, PINS_PER_BANK) -
960 pctl->desc->pin_base; 960 pctl->desc->pin_base;
961 pctl->chip->label = dev_name(&pdev->dev); 961 pctl->chip->label = dev_name(&pdev->dev);
962 pctl->chip->dev = &pdev->dev; 962 pctl->chip->parent = &pdev->dev;
963 pctl->chip->base = pctl->desc->pin_base; 963 pctl->chip->base = pctl->desc->pin_base;
964 964
965 ret = gpiochip_add(pctl->chip); 965 ret = gpiochip_add(pctl->chip);
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index fb22d3f62480..e9c1dfd90570 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -488,7 +488,7 @@ static struct pinctrl_desc wmt_desc = {
488 488
489static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) 489static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
490{ 490{
491 struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev); 491 struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent);
492 u32 bank = WMT_BANK_FROM_PIN(offset); 492 u32 bank = WMT_BANK_FROM_PIN(offset);
493 u32 bit = WMT_BIT_FROM_PIN(offset); 493 u32 bit = WMT_BIT_FROM_PIN(offset);
494 u32 reg_dir = data->banks[bank].reg_dir; 494 u32 reg_dir = data->banks[bank].reg_dir;
@@ -503,7 +503,7 @@ static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
503 503
504static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset) 504static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset)
505{ 505{
506 struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev); 506 struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent);
507 u32 bank = WMT_BANK_FROM_PIN(offset); 507 u32 bank = WMT_BANK_FROM_PIN(offset);
508 u32 bit = WMT_BIT_FROM_PIN(offset); 508 u32 bit = WMT_BIT_FROM_PIN(offset);
509 u32 reg_data_in = data->banks[bank].reg_data_in; 509 u32 reg_data_in = data->banks[bank].reg_data_in;
@@ -519,7 +519,7 @@ static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset)
519static void wmt_gpio_set_value(struct gpio_chip *chip, unsigned offset, 519static void wmt_gpio_set_value(struct gpio_chip *chip, unsigned offset,
520 int val) 520 int val)
521{ 521{
522 struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev); 522 struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent);
523 u32 bank = WMT_BANK_FROM_PIN(offset); 523 u32 bank = WMT_BANK_FROM_PIN(offset);
524 u32 bit = WMT_BIT_FROM_PIN(offset); 524 u32 bit = WMT_BIT_FROM_PIN(offset);
525 u32 reg_data_out = data->banks[bank].reg_data_out; 525 u32 reg_data_out = data->banks[bank].reg_data_out;
@@ -575,7 +575,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
575 wmt_desc.npins = data->npins; 575 wmt_desc.npins = data->npins;
576 576
577 data->gpio_chip = wmt_gpio_chip; 577 data->gpio_chip = wmt_gpio_chip;
578 data->gpio_chip.dev = &pdev->dev; 578 data->gpio_chip.parent = &pdev->dev;
579 data->gpio_chip.of_node = pdev->dev.of_node; 579 data->gpio_chip.of_node = pdev->dev.of_node;
580 data->gpio_chip.ngpio = data->nbanks * 32; 580 data->gpio_chip.ngpio = data->nbanks * 32;
581 581
diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c
index 709f0afdafa8..0e73fd10ba72 100644
--- a/drivers/platform/x86/intel_pmic_gpio.c
+++ b/drivers/platform/x86/intel_pmic_gpio.c
@@ -274,11 +274,11 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev)
274 pg->chip.base = pdata->gpio_base; 274 pg->chip.base = pdata->gpio_base;
275 pg->chip.ngpio = NUM_GPIO; 275 pg->chip.ngpio = NUM_GPIO;
276 pg->chip.can_sleep = 1; 276 pg->chip.can_sleep = 1;
277 pg->chip.dev = dev; 277 pg->chip.parent = dev;
278 278
279 mutex_init(&pg->buslock); 279 mutex_init(&pg->buslock);
280 280
281 pg->chip.dev = dev; 281 pg->chip.parent = dev;
282 retval = gpiochip_add(&pg->chip); 282 retval = gpiochip_add(&pg->chip);
283 if (retval) { 283 if (retval) {
284 pr_err("Can not add pmic gpio chip\n"); 284 pr_err("Can not add pmic gpio chip\n");
diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index d45133056f51..3f98165b479c 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -1174,7 +1174,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
1174#ifdef CONFIG_GPIOLIB 1174#ifdef CONFIG_GPIOLIB
1175 /* Setup GPIO cotroller */ 1175 /* Setup GPIO cotroller */
1176 s->gpio.owner = THIS_MODULE; 1176 s->gpio.owner = THIS_MODULE;
1177 s->gpio.dev = dev; 1177 s->gpio.parent = dev;
1178 s->gpio.label = dev_name(dev); 1178 s->gpio.label = dev_name(dev);
1179 s->gpio.direction_input = max310x_gpio_direction_input; 1179 s->gpio.direction_input = max310x_gpio_direction_input;
1180 s->gpio.get = max310x_gpio_get; 1180 s->gpio.get = max310x_gpio_get;
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index edb5305b9d4d..cc86c348d809 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1180,7 +1180,7 @@ static int sc16is7xx_probe(struct device *dev,
1180 if (devtype->nr_gpio) { 1180 if (devtype->nr_gpio) {
1181 /* Setup GPIO cotroller */ 1181 /* Setup GPIO cotroller */
1182 s->gpio.owner = THIS_MODULE; 1182 s->gpio.owner = THIS_MODULE;
1183 s->gpio.dev = dev; 1183 s->gpio.parent = dev;
1184 s->gpio.label = dev_name(dev); 1184 s->gpio.label = dev_name(dev);
1185 s->gpio.direction_input = sc16is7xx_gpio_direction_input; 1185 s->gpio.direction_input = sc16is7xx_gpio_direction_input;
1186 s->gpio.get = sc16is7xx_gpio_get; 1186 s->gpio.get = sc16is7xx_gpio_get;
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index d1baebf350d8..b02c43be7859 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -20,7 +20,7 @@ struct seq_file;
20/** 20/**
21 * struct gpio_chip - abstract a GPIO controller 21 * struct gpio_chip - abstract a GPIO controller
22 * @label: for diagnostics 22 * @label: for diagnostics
23 * @dev: optional device providing the GPIOs 23 * @parent: optional parent device providing the GPIOs
24 * @cdev: class device used by sysfs interface (may be NULL) 24 * @cdev: class device used by sysfs interface (may be NULL)
25 * @owner: helps prevent removal of modules exporting active GPIOs 25 * @owner: helps prevent removal of modules exporting active GPIOs
26 * @list: links gpio_chips together for traversal 26 * @list: links gpio_chips together for traversal
@@ -89,7 +89,7 @@ struct seq_file;
89 */ 89 */
90struct gpio_chip { 90struct gpio_chip {
91 const char *label; 91 const char *label;
92 struct device *dev; 92 struct device *parent;
93 struct device *cdev; 93 struct device *cdev;
94 struct module *owner; 94 struct module *owner;
95 struct list_head list; 95 struct list_head list;
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;