gpio: change member .dev to .parent
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 4 Nov 2015 08:56:26 +0000 (09:56 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 19 Nov 2015 08:24:35 +0000 (09:24 +0100)
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>
128 files changed:
arch/avr32/mach-at32ap/pio.c
drivers/bcma/driver_gpio.c
drivers/gpio/gpio-104-idio-16.c
drivers/gpio/gpio-74x164.c
drivers/gpio/gpio-adnp.c
drivers/gpio/gpio-altera.c
drivers/gpio/gpio-amd8111.c
drivers/gpio/gpio-amdpt.c
drivers/gpio/gpio-arizona.c
drivers/gpio/gpio-ath79.c
drivers/gpio/gpio-bcm-kona.c
drivers/gpio/gpio-crystalcove.c
drivers/gpio/gpio-davinci.c
drivers/gpio/gpio-dln2.c
drivers/gpio/gpio-em.c
drivers/gpio/gpio-f7188x.c
drivers/gpio/gpio-generic.c
drivers/gpio/gpio-ich.c
drivers/gpio/gpio-intel-mid.c
drivers/gpio/gpio-janz-ttl.c
drivers/gpio/gpio-kempld.c
drivers/gpio/gpio-lp3943.c
drivers/gpio/gpio-lpc18xx.c
drivers/gpio/gpio-lynxpoint.c
drivers/gpio/gpio-max730x.c
drivers/gpio/gpio-max732x.c
drivers/gpio/gpio-mb86s7x.c
drivers/gpio/gpio-mc33880.c
drivers/gpio/gpio-mc9s08dz60.c
drivers/gpio/gpio-mcp23s08.c
drivers/gpio/gpio-moxart.c
drivers/gpio/gpio-msic.c
drivers/gpio/gpio-mvebu.c
drivers/gpio/gpio-octeon.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-palmas.c
drivers/gpio/gpio-pca953x.c
drivers/gpio/gpio-pcf857x.c
drivers/gpio/gpio-pch.c
drivers/gpio/gpio-pl061.c
drivers/gpio/gpio-rc5t583.c
drivers/gpio/gpio-rcar.c
drivers/gpio/gpio-sch.c
drivers/gpio/gpio-sch311x.c
drivers/gpio/gpio-spear-spics.c
drivers/gpio/gpio-stmpe.c
drivers/gpio/gpio-stp-xway.c
drivers/gpio/gpio-sx150x.c
drivers/gpio/gpio-syscon.c
drivers/gpio/gpio-tb10x.c
drivers/gpio/gpio-tc3589x.c
drivers/gpio/gpio-timberdale.c
drivers/gpio/gpio-tps6586x.c
drivers/gpio/gpio-tps65910.c
drivers/gpio/gpio-tps65912.c
drivers/gpio/gpio-ts5500.c
drivers/gpio/gpio-twl4030.c
drivers/gpio/gpio-twl6040.c
drivers/gpio/gpio-tz1090-pdc.c
drivers/gpio/gpio-tz1090.c
drivers/gpio/gpio-vf610.c
drivers/gpio/gpio-viperboard.c
drivers/gpio/gpio-vr41xx.c
drivers/gpio/gpio-wm831x.c
drivers/gpio/gpio-wm8350.c
drivers/gpio/gpio-wm8994.c
drivers/gpio/gpio-xgene.c
drivers/gpio/gpio-xilinx.c
drivers/gpio/gpio-xlp.c
drivers/gpio/gpio-zevio.c
drivers/gpio/gpio-zx.c
drivers/gpio/gpio-zynq.c
drivers/gpio/gpiolib-acpi.c
drivers/gpio/gpiolib-of.c
drivers/gpio/gpiolib-sysfs.c
drivers/gpio/gpiolib.c
drivers/hid/hid-cp2112.c
drivers/input/touchscreen/ad7879.c
drivers/leds/leds-pca9532.c
drivers/leds/leds-tca6507.c
drivers/media/dvb-frontends/cxd2820r_core.c
drivers/mfd/dm355evm_msp.c
drivers/mfd/htc-egpio.c
drivers/mfd/htc-i2cpld.c
drivers/mfd/tps65010.c
drivers/mfd/ucb1x00-core.c
drivers/pinctrl/bcm/pinctrl-bcm2835.c
drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c
drivers/pinctrl/intel/pinctrl-baytrail.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/pinctrl/intel/pinctrl-intel.c
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
drivers/pinctrl/meson/pinctrl-meson.c
drivers/pinctrl/nomadik/pinctrl-abx500.c
drivers/pinctrl/nomadik/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-amd.c
drivers/pinctrl/pinctrl-as3722.c
drivers/pinctrl/pinctrl-at91-pio4.c
drivers/pinctrl/pinctrl-at91.c
drivers/pinctrl/pinctrl-coh901.c
drivers/pinctrl/pinctrl-digicolor.c
drivers/pinctrl/pinctrl-pistachio.c
drivers/pinctrl/pinctrl-rockchip.c
drivers/pinctrl/pinctrl-st.c
drivers/pinctrl/pinctrl-xway.c
drivers/pinctrl/qcom/pinctrl-msm.c
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
drivers/pinctrl/samsung/pinctrl-exynos.c
drivers/pinctrl/samsung/pinctrl-exynos5440.c
drivers/pinctrl/samsung/pinctrl-samsung.c
drivers/pinctrl/sh-pfc/gpio.c
drivers/pinctrl/sirf/pinctrl-atlas7.c
drivers/pinctrl/sirf/pinctrl-sirf.c
drivers/pinctrl/spear/pinctrl-plgpio.c
drivers/pinctrl/sunxi/pinctrl-sunxi.c
drivers/pinctrl/vt8500/pinctrl-wmt.c
drivers/platform/x86/intel_pmic_gpio.c
drivers/tty/serial/max310x.c
drivers/tty/serial/sc16is7xx.c
include/linux/gpio/driver.h
sound/soc/codecs/rt5677.c
sound/soc/codecs/wm5100.c
sound/soc/codecs/wm8903.c
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8996.c

index 4f61378c3453792af416dae65ffa1e9a8c70f4ff..aa74491771fa6fa88c3a5338d61afb86cb45a69e 100644 (file)
@@ -397,7 +397,7 @@ static int __init pio_probe(struct platform_device *pdev)
        pio->chip.label = pio->name;
        pio->chip.base = pdev->id * 32;
        pio->chip.ngpio = 32;
-       pio->chip.dev = &pdev->dev;
+       pio->chip.parent = &pdev->dev;
        pio->chip.owner = THIS_MODULE;
 
        pio->chip.direction_input = direction_input;
index 504899a7296649cecf922065e29282189f6d3d3b..949754427ce27b677fea518d8b9749bc36122264 100644 (file)
@@ -188,7 +188,7 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
        chip->direction_input   = bcma_gpio_direction_input;
        chip->direction_output  = bcma_gpio_direction_output;
        chip->owner             = THIS_MODULE;
-       chip->dev               = bcma_bus_get_host_dev(bus);
+       chip->parent            = bcma_bus_get_host_dev(bus);
 #if IS_BUILTIN(CONFIG_OF)
        if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC)
                chip->of_node   = cc->core->dev.of_node;
index 5400d7d4d8fd1ec7c0c1292540bd9da354c729ce..107cfd7105a8ed06eccc719d8baa04c0d2ff943b 100644 (file)
@@ -127,7 +127,7 @@ static int __init idio_16_probe(struct platform_device *pdev)
        }
 
        idio16gpio->chip.label = NAME;
-       idio16gpio->chip.dev = dev;
+       idio16gpio->chip.parent = dev;
        idio16gpio->chip.owner = THIS_MODULE;
        idio16gpio->chip.base = -1;
        idio16gpio->chip.ngpio = 32;
index 60172f835d15f1398fa8c7ac58901f40d0a5914c..fb555300008f491e32bb5d82a1610172a44d880c 100644 (file)
@@ -33,7 +33,7 @@ static struct gen_74x164_chip *gpio_to_74x164_chip(struct gpio_chip *gc)
 
 static int __gen_74x164_write_config(struct gen_74x164_chip *chip)
 {
-       struct spi_device *spi = to_spi_device(chip->gpio_chip.dev);
+       struct spi_device *spi = to_spi_device(chip->gpio_chip.parent);
        struct spi_message message;
        struct spi_transfer *msg_buf;
        int i, ret = 0;
@@ -143,7 +143,7 @@ static int gen_74x164_probe(struct spi_device *spi)
                return -ENOMEM;
 
        chip->gpio_chip.can_sleep = true;
-       chip->gpio_chip.dev = &spi->dev;
+       chip->gpio_chip.parent = &spi->dev;
        chip->gpio_chip.owner = THIS_MODULE;
 
        mutex_init(&chip->lock);
index d3d0a90fe5420853afeb5442e155005b415949b4..b34a62a5a7e12823c99d39401224182a62a216d4 100644 (file)
@@ -47,7 +47,7 @@ static int adnp_read(struct adnp *adnp, unsigned offset, uint8_t *value)
 
        err = i2c_smbus_read_byte_data(adnp->client, offset);
        if (err < 0) {
-               dev_err(adnp->gpio.dev, "%s failed: %d\n",
+               dev_err(adnp->gpio.parent, "%s failed: %d\n",
                        "i2c_smbus_read_byte_data()", err);
                return err;
        }
@@ -62,7 +62,7 @@ static int adnp_write(struct adnp *adnp, unsigned offset, uint8_t value)
 
        err = i2c_smbus_write_byte_data(adnp->client, offset, value);
        if (err < 0) {
-               dev_err(adnp->gpio.dev, "%s failed: %d\n",
+               dev_err(adnp->gpio.parent, "%s failed: %d\n",
                        "i2c_smbus_write_byte_data()", err);
                return err;
        }
@@ -266,8 +266,8 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios)
        chip->base = -1;
        chip->ngpio = num_gpios;
        chip->label = adnp->client->name;
-       chip->dev = &adnp->client->dev;
-       chip->of_node = chip->dev->of_node;
+       chip->parent = &adnp->client->dev;
+       chip->of_node = chip->parent->of_node;
        chip->owner = THIS_MODULE;
 
        err = gpiochip_add(chip);
@@ -435,7 +435,8 @@ static int adnp_irq_setup(struct adnp *adnp)
         * is chosen to match the register layout of the hardware in that
         * each segment contains the corresponding bits for all interrupts.
         */
-       adnp->irq_enable = devm_kzalloc(chip->dev, num_regs * 6, GFP_KERNEL);
+       adnp->irq_enable = devm_kzalloc(chip->parent, num_regs * 6,
+                                       GFP_KERNEL);
        if (!adnp->irq_enable)
                return -ENOMEM;
 
@@ -462,12 +463,12 @@ static int adnp_irq_setup(struct adnp *adnp)
                adnp->irq_enable[i] = 0x00;
        }
 
-       err = devm_request_threaded_irq(chip->dev, adnp->client->irq,
+       err = devm_request_threaded_irq(chip->parent, adnp->client->irq,
                                        NULL, adnp_irq,
                                        IRQF_TRIGGER_RISING | IRQF_ONESHOT,
-                                       dev_name(chip->dev), adnp);
+                                       dev_name(chip->parent), adnp);
        if (err != 0) {
-               dev_err(chip->dev, "can't request IRQ#%d: %d\n",
+               dev_err(chip->parent, "can't request IRQ#%d: %d\n",
                        adnp->client->irq, err);
                return err;
        }
@@ -478,7 +479,7 @@ static int adnp_irq_setup(struct adnp *adnp)
                                   handle_simple_irq,
                                   IRQ_TYPE_NONE);
        if (err) {
-               dev_err(chip->dev,
+               dev_err(chip->parent,
                        "could not connect irqchip to gpiochip\n");
                return err;
        }
index 3e6661bab54aed3a7fe05c6c5748622032017b46..84a20af01a9a851080f4219fa9315944b8206908 100644 (file)
@@ -290,7 +290,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
        altera_gc->mmchip.gc.get                = altera_gpio_get;
        altera_gc->mmchip.gc.set                = altera_gpio_set;
        altera_gc->mmchip.gc.owner              = THIS_MODULE;
-       altera_gc->mmchip.gc.dev                = &pdev->dev;
+       altera_gc->mmchip.gc.parent             = &pdev->dev;
 
        ret = of_mm_gpiochip_add(node, &altera_gc->mmchip);
        if (ret) {
index d00d81928fe84145102afc156766288c11a30150..5c378e9f53a0289dbd0a930417e4c128833dabb4 100644 (file)
@@ -220,7 +220,7 @@ found:
                goto out;
        }
        gp.pdev = pdev;
-       gp.chip.dev = &pdev->dev;
+       gp.chip.parent = &pdev->dev;
 
        spin_lock_init(&gp.lock);
 
index cbbb966d4fc04f22cdce248a989a9a20ebda253a..f842ccc45e648a53385c5ba2ffd9a0fe8a54f930 100644 (file)
@@ -39,14 +39,14 @@ static int pt_gpio_request(struct gpio_chip *gc, unsigned offset)
        unsigned long flags;
        u32 using_pins;
 
-       dev_dbg(gc->dev, "pt_gpio_request offset=%x\n", offset);
+       dev_dbg(gc->parent, "pt_gpio_request offset=%x\n", offset);
 
        spin_lock_irqsave(&pt_gpio->lock, flags);
 
        using_pins = readl(pt_gpio->reg_base + PT_SYNC_REG);
        if (using_pins & BIT(offset)) {
-               dev_warn(gc->dev, "PT GPIO pin %x reconfigured\n",
-                       offset);
+               dev_warn(gc->parent, "PT GPIO pin %x reconfigured\n",
+                        offset);
                spin_unlock_irqrestore(&pt_gpio->lock, flags);
                return -EINVAL;
        }
@@ -72,7 +72,7 @@ static void pt_gpio_free(struct gpio_chip *gc, unsigned offset)
 
        spin_unlock_irqrestore(&pt_gpio->lock, flags);
 
-       dev_dbg(gc->dev, "pt_gpio_free offset=%x\n", offset);
+       dev_dbg(gc->parent, "pt_gpio_free offset=%x\n", offset);
 }
 
 static 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)
        unsigned long flags;
        u32 data;
 
-       dev_dbg(gc->dev, "pt_gpio_set_value offset=%x, value=%x\n",
+       dev_dbg(gc->parent, "pt_gpio_set_value offset=%x, value=%x\n",
                offset, value);
 
        spin_lock_irqsave(&pt_gpio->lock, flags);
@@ -116,7 +116,7 @@ static int pt_gpio_get_value(struct gpio_chip *gc, unsigned offset)
        data >>= offset;
        data &= 1;
 
-       dev_dbg(gc->dev, "pt_gpio_get_value offset=%x, value=%x\n",
+       dev_dbg(gc->parent, "pt_gpio_get_value offset=%x, value=%x\n",
                offset, data);
 
        return data;
@@ -128,7 +128,7 @@ static int pt_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
        unsigned long flags;
        u32 data;
 
-       dev_dbg(gc->dev, "pt_gpio_dirction_input offset=%x\n", offset);
+       dev_dbg(gc->parent, "pt_gpio_dirction_input offset=%x\n", offset);
 
        spin_lock_irqsave(&pt_gpio->lock, flags);
 
@@ -148,7 +148,7 @@ static int pt_gpio_direction_output(struct gpio_chip *gc,
        unsigned long flags;
        u32 data;
 
-       dev_dbg(gc->dev, "pt_gpio_direction_output offset=%x, value=%x\n",
+       dev_dbg(gc->parent, "pt_gpio_direction_output offset=%x, value=%x\n",
                offset, value);
 
        spin_lock_irqsave(&pt_gpio->lock, flags);
@@ -202,7 +202,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
 
        pt_gpio->gc.label            = pdev->name;
        pt_gpio->gc.owner            = THIS_MODULE;
-       pt_gpio->gc.dev              = dev;
+       pt_gpio->gc.parent              = dev;
        pt_gpio->gc.request          = pt_gpio_request;
        pt_gpio->gc.free             = pt_gpio_free;
        pt_gpio->gc.direction_input  = pt_gpio_direction_input;
index ca002739616af3969431482de5a9df6a6e96a975..412d131b513d3e8474fdf6a2174cf6c886325668 100644 (file)
@@ -108,7 +108,7 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 
        arizona_gpio->arizona = arizona;
        arizona_gpio->gpio_chip = template_chip;
-       arizona_gpio->gpio_chip.dev = &pdev->dev;
+       arizona_gpio->gpio_chip.parent = &pdev->dev;
 #ifdef CONFIG_OF_GPIO
        arizona_gpio->gpio_chip.of_node = arizona->dev->of_node;
 #endif
index e5827a56ff3b5eda451202849c41b2d8b0e54f31..b1410226dc956522ae113c030c83b8584ecc96f2 100644 (file)
@@ -177,7 +177,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
 
        spin_lock_init(&ctrl->lock);
        memcpy(&ctrl->chip, &ath79_gpio_chip, sizeof(ctrl->chip));
-       ctrl->chip.dev = &pdev->dev;
+       ctrl->chip.parent = &pdev->dev;
        ctrl->chip.ngpio = ath79_gpio_count;
        if (oe_inverted) {
                ctrl->chip.direction_input = ar934x_gpio_direction_input;
index 33a1f9779b86bb1e422d3144f69c600409e9221d..21c3280d66e1090ac658c7f6126baa7c9549c6d3 100644 (file)
@@ -273,7 +273,7 @@ static int bcm_kona_gpio_set_debounce(struct gpio_chip *chip, unsigned gpio,
        reg_base = kona_gpio->reg_base;
        /* debounce must be 1-128ms (or 0) */
        if ((debounce > 0 && debounce < 1000) || debounce > 128000) {
-               dev_err(chip->dev, "Debounce value %u not in range\n",
+               dev_err(chip->parent, "Debounce value %u not in range\n",
                        debounce);
                return -EINVAL;
        }
@@ -416,7 +416,7 @@ static int bcm_kona_gpio_irq_set_type(struct irq_data *d, unsigned int type)
        case IRQ_TYPE_LEVEL_LOW:
                /* BCM GPIO doesn't support level triggering */
        default:
-               dev_err(kona_gpio->gpio_chip.dev,
+               dev_err(kona_gpio->gpio_chip.parent,
                        "Invalid BCM GPIO irq type 0x%x\n", type);
                return -EINVAL;
        }
@@ -477,7 +477,7 @@ static int bcm_kona_gpio_irq_reqres(struct irq_data *d)
        struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d);
 
        if (gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq)) {
-               dev_err(kona_gpio->gpio_chip.dev,
+               dev_err(kona_gpio->gpio_chip.parent,
                        "unable to lock HW IRQ %lu for IRQ\n",
                        d->hwirq);
                return -EINVAL;
index fddd204dc9b68484c473c267803b9d1216fe4535..141093a8cd3fc0703995fceaf63b78696d10f493 100644 (file)
@@ -341,7 +341,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
        cg->chip.base = -1;
        cg->chip.ngpio = CRYSTALCOVE_VGPIO_NUM;
        cg->chip.can_sleep = true;
-       cg->chip.dev = dev;
+       cg->chip.parent = dev;
        cg->chip.dbg_show = crystalcove_gpio_dbg_show;
        cg->regmap = pmic->regmap;
 
index 5e715388803db555d7180fc9b6c3b24f1c7f48dc..cf31179726b136861ad6ac69b6fb3d33ef2b9518 100644 (file)
@@ -179,8 +179,8 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc,
                             const struct of_phandle_args *gpiospec,
                             u32 *flags)
 {
-       struct davinci_gpio_controller *chips = dev_get_drvdata(gc->dev);
-       struct davinci_gpio_platform_data *pdata = dev_get_platdata(gc->dev);
+       struct davinci_gpio_controller *chips = dev_get_drvdata(gc->parent);
+       struct davinci_gpio_platform_data *pdata = dev_get_platdata(gc->parent);
 
        if (gpiospec->args[0] > pdata->ngpio)
                return -EINVAL;
index 6685712c15cf0f2409aa10c7ea511fa1f5f913c5..e541af03dd45fd2968fd8831fdfa22ecb7f8f0b9 100644 (file)
@@ -377,7 +377,7 @@ static void dln2_irq_bus_unlock(struct irq_data *irqd)
 
                ret = dln2_gpio_set_event_cfg(dln2, pin, type, 0);
                if (ret)
-                       dev_err(dln2->gpio.dev, "failed to set event\n");
+                       dev_err(dln2->gpio.parent, "failed to set event\n");
        }
 
        mutex_unlock(&dln2->irq_lock);
@@ -406,19 +406,19 @@ static void dln2_gpio_event(struct platform_device *pdev, u16 echo,
        struct dln2_gpio *dln2 = platform_get_drvdata(pdev);
 
        if (len < sizeof(*event)) {
-               dev_err(dln2->gpio.dev, "short event message\n");
+               dev_err(dln2->gpio.parent, "short event message\n");
                return;
        }
 
        pin = le16_to_cpu(event->pin);
        if (pin >= dln2->gpio.ngpio) {
-               dev_err(dln2->gpio.dev, "out of bounds pin %d\n", pin);
+               dev_err(dln2->gpio.parent, "out of bounds pin %d\n", pin);
                return;
        }
 
        irq = irq_find_mapping(dln2->gpio.irqdomain, pin);
        if (!irq) {
-               dev_err(dln2->gpio.dev, "pin %d not mapped to IRQ\n", pin);
+               dev_err(dln2->gpio.parent, "pin %d not mapped to IRQ\n", pin);
                return;
        }
 
@@ -462,7 +462,7 @@ static int dln2_gpio_probe(struct platform_device *pdev)
        dln2->pdev = pdev;
 
        dln2->gpio.label = "dln2";
-       dln2->gpio.dev = dev;
+       dln2->gpio.parent = dev;
        dln2->gpio.owner = THIS_MODULE;
        dln2->gpio.base = -1;
        dln2->gpio.ngpio = pins;
index 6bca1e125e1234b8e38f069f7e5b1ef6395b3cff..c3ca2b1c1dfe1cb4a444bdd5ec2c54ad9415a038 100644 (file)
@@ -103,7 +103,7 @@ static int em_gio_irq_reqres(struct irq_data *d)
        struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
 
        if (gpiochip_lock_as_irq(&p->gpio_chip, irqd_to_hwirq(d))) {
-               dev_err(p->gpio_chip.dev,
+               dev_err(p->gpio_chip.parent,
                        "unable to lock HW IRQ %lu for IRQ\n",
                        irqd_to_hwirq(d));
                return -EINVAL;
@@ -332,7 +332,7 @@ static int em_gio_probe(struct platform_device *pdev)
        gpio_chip->request = em_gio_request;
        gpio_chip->free = em_gio_free;
        gpio_chip->label = name;
-       gpio_chip->dev = &pdev->dev;
+       gpio_chip->parent = &pdev->dev;
        gpio_chip->owner = THIS_MODULE;
        gpio_chip->base = -1;
        gpio_chip->ngpio = ngpios;
index 5e3c4fa67d820f4dfd22c5409c4194f7d1faff2c..1734e4fbd2b501a20a606709ad9d59d2ffb0e84d 100644 (file)
@@ -333,7 +333,7 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
        for (i = 0; i < data->nr_bank; i++) {
                struct f7188x_gpio_bank *bank = &data->bank[i];
 
-               bank->chip.dev = &pdev->dev;
+               bank->chip.parent = &pdev->dev;
                bank->data = data;
 
                err = gpiochip_add(&bank->chip);
index bd5193c67a9c272cb0bebf779ce3277d22aac479..72088028d7a9fd76820760c5868fd8de8cc6a3d0 100644 (file)
@@ -545,7 +545,7 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
                return -EINVAL;
 
        spin_lock_init(&bgc->lock);
-       bgc->gc.dev = dev;
+       bgc->gc.parent = dev;
        bgc->gc.label = dev_name(dev);
        bgc->gc.base = -1;
        bgc->gc.ngpio = bgc->bits;
index 4ba7ed502131ad1565aa76ac863a07cd53c151b1..8623d12e23c1b33a0ea6cd98e51b305ef11f3ac3 100644 (file)
@@ -282,7 +282,7 @@ static void ichx_gpiolib_setup(struct gpio_chip *chip)
 {
        chip->owner = THIS_MODULE;
        chip->label = DRV_NAME;
-       chip->dev = &ichx_priv.dev->dev;
+       chip->parent = &ichx_priv.dev->dev;
 
        /* Allow chip-specific overrides of request()/get() */
        chip->request = ichx_priv.desc->request ?
index 70097472b02cc7cb9332f9e59cac750720e21c54..1c46a7ef268078f04a360c1a0b205185d660df58 100644 (file)
@@ -392,7 +392,7 @@ static int intel_gpio_probe(struct pci_dev *pdev,
 
        priv->reg_base = pcim_iomap_table(pdev)[0];
        priv->chip.label = dev_name(&pdev->dev);
-       priv->chip.dev = &pdev->dev;
+       priv->chip.parent = &pdev->dev;
        priv->chip.request = intel_gpio_request;
        priv->chip.direction_input = intel_gpio_direction_input;
        priv->chip.direction_output = intel_gpio_direction_output;
index 3a1664335f5e302b920440ef43c463867c88dfb1..e5f85cab010079dd8e484ea63296dd8ec1c0ca96 100644 (file)
@@ -59,7 +59,7 @@ struct ttl_module {
 
 static int ttl_get_value(struct gpio_chip *gpio, unsigned offset)
 {
-       struct ttl_module *mod = dev_get_drvdata(gpio->dev);
+       struct ttl_module *mod = dev_get_drvdata(gpio->parent);
        u8 *shadow;
        int ret;
 
@@ -81,7 +81,7 @@ static int ttl_get_value(struct gpio_chip *gpio, unsigned offset)
 
 static void ttl_set_value(struct gpio_chip *gpio, unsigned offset, int value)
 {
-       struct ttl_module *mod = dev_get_drvdata(gpio->dev);
+       struct ttl_module *mod = dev_get_drvdata(gpio->parent);
        void __iomem *port;
        u8 *shadow;
 
@@ -172,7 +172,7 @@ static int ttl_probe(struct platform_device *pdev)
 
        /* Initialize the GPIO data structures */
        gpio = &mod->gpio;
-       gpio->dev = &pdev->dev;
+       gpio->parent = &pdev->dev;
        gpio->label = pdev->name;
        gpio->get = ttl_get_value;
        gpio->set = ttl_set_value;
index 83f281dda1e0f41fc4be3c8d2cb4e02407ab837d..35dd1e0af364609a909e44c724ff4d6e3bca6f41 100644 (file)
@@ -166,7 +166,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
        chip = &gpio->chip;
        chip->label = "gpio-kempld";
        chip->owner = THIS_MODULE;
-       chip->dev = dev;
+       chip->parent = dev;
        chip->can_sleep = true;
        if (pdata && pdata->gpio_base)
                chip->base = pdata->gpio_base;
index cfc5b12b43ad857591d9292fe78cbbee46556ca4..f979c3be217f3ad0503d6d0ca9e31b1769bac2cc 100644 (file)
@@ -205,7 +205,7 @@ static int lp3943_gpio_probe(struct platform_device *pdev)
 
        lp3943_gpio->lp3943 = lp3943;
        lp3943_gpio->chip = lp3943_gpio_chip;
-       lp3943_gpio->chip.dev = &pdev->dev;
+       lp3943_gpio->chip.parent = &pdev->dev;
 
        platform_set_drvdata(pdev, lp3943_gpio);
 
index e39dcb0af8ae1b918a56672314f63d9913d3e238..b01fbc9db7cdcd12acc349d04376364133ef49aa 100644 (file)
@@ -127,7 +127,7 @@ static int lpc18xx_gpio_probe(struct platform_device *pdev)
 
        spin_lock_init(&gc->lock);
 
-       gc->gpio.dev = &pdev->dev;
+       gc->gpio.parent = &pdev->dev;
 
        ret = gpiochip_add(&gc->gpio);
        if (ret) {
index 127c37b380ae21c1d8ff85a3913ab11e1b76613f..6a48ffd6e0dbcf3578b862dd31162e79b56c8766 100644 (file)
@@ -368,7 +368,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
        gc->base = -1;
        gc->ngpio = LP_NUM_GPIO;
        gc->can_sleep = false;
-       gc->dev = dev;
+       gc->parent = dev;
 
        ret = gpiochip_add(gc);
        if (ret) {
index 0f57d2d248ec9e367ac67a9194e2b3c8e9460948..5d6a723cb4147b1f22987256ce4ea4c634d17f77 100644 (file)
@@ -189,7 +189,7 @@ int __max730x_probe(struct max7301 *ts)
 
        ts->chip.ngpio = PIN_NUMBER;
        ts->chip.can_sleep = true;
-       ts->chip.dev = dev;
+       ts->chip.parent = dev;
        ts->chip.owner = THIS_MODULE;
 
        /*
index 8c5252c6c327764cb6fc4ae99f321e2cdf830537..c1e7b55644b0014dc08658daceba8ff3ce77b7e0 100644 (file)
@@ -603,7 +603,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip,
        gc->base = gpio_start;
        gc->ngpio = port;
        gc->label = chip->client->name;
-       gc->dev = &chip->client->dev;
+       gc->parent = &chip->client->dev;
        gc->owner = THIS_MODULE;
 
        return port;
@@ -649,7 +649,7 @@ static int max732x_probe(struct i2c_client *client,
        chip->client = client;
 
        nr_port = max732x_setup_gpio(chip, id, pdata->gpio_base);
-       chip->gpio_chip.dev = &client->dev;
+       chip->gpio_chip.parent = &client->dev;
 
        addr_a = (client->addr & 0x0f) | 0x60;
        addr_b = (client->addr & 0x0f) | 0x50;
index ee93c0ab0a597d8d41a0d86c26d2b1ac34ac0e6b..93d61a5be0d441521b7ed75dff9c54539a98e9cf 100644 (file)
@@ -187,7 +187,7 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
        gchip->gc.label = dev_name(&pdev->dev);
        gchip->gc.ngpio = 32;
        gchip->gc.owner = THIS_MODULE;
-       gchip->gc.dev = &pdev->dev;
+       gchip->gc.parent = &pdev->dev;
        gchip->gc.base = -1;
 
        platform_set_drvdata(pdev, gchip);
index 2853731db5bc297fbe5fe96afd6cf9b9e16f2935..b46b9e522e8cb3910b39b5e6bb5ad437717e342b 100644 (file)
@@ -116,7 +116,7 @@ static int mc33880_probe(struct spi_device *spi)
        mc->chip.base = pdata->base;
        mc->chip.ngpio = PIN_NUMBER;
        mc->chip.can_sleep = true;
-       mc->chip.dev = &spi->dev;
+       mc->chip.parent = &spi->dev;
        mc->chip.owner = THIS_MODULE;
 
        mc->port_config = 0x00;
index d62b4f8182bf0c9ca7259299fd1451e85b358e81..defa38f958fb23a05b8b1d054dc60cc2bccf08ee 100644 (file)
@@ -99,7 +99,7 @@ static int mc9s08dz60_probe(struct i2c_client *client,
 
        mc9s->chip.label = client->name;
        mc9s->chip.base = -1;
-       mc9s->chip.dev = &client->dev;
+       mc9s->chip.parent = &client->dev;
        mc9s->chip.owner = THIS_MODULE;
        mc9s->chip.ngpio = GPIO_NUM;
        mc9s->chip.can_sleep = true;
index 4a41694919dae1e1d960da377b2e7ce48a593dec..13cace0ca6f7ebfed94e58d6a5f870b09a468fa6 100644 (file)
@@ -446,7 +446,7 @@ static int mcp23s08_irq_reqres(struct irq_data *data)
        struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
 
        if (gpiochip_lock_as_irq(&mcp->chip, data->hwirq)) {
-               dev_err(mcp->chip.dev,
+               dev_err(mcp->chip.parent,
                        "unable to lock HW IRQ %lu for IRQ usage\n",
                        data->hwirq);
                return -EINVAL;
@@ -481,7 +481,8 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
 
        mutex_init(&mcp->irq_lock);
 
-       mcp->irq_domain = irq_domain_add_linear(chip->dev->of_node, chip->ngpio,
+       mcp->irq_domain = irq_domain_add_linear(chip->parent->of_node,
+                                               chip->ngpio,
                                                &irq_domain_simple_ops, mcp);
        if (!mcp->irq_domain)
                return -ENODEV;
@@ -491,10 +492,11 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
        else
                irqflags |= IRQF_TRIGGER_LOW;
 
-       err = devm_request_threaded_irq(chip->dev, mcp->irq, NULL, mcp23s08_irq,
-                                       irqflags, dev_name(chip->dev), mcp);
+       err = devm_request_threaded_irq(chip->parent, mcp->irq, NULL,
+                                       mcp23s08_irq,
+                                       irqflags, dev_name(chip->parent), mcp);
        if (err != 0) {
-               dev_err(chip->dev, "unable to request IRQ#%d: %d\n",
+               dev_err(chip->parent, "unable to request IRQ#%d: %d\n",
                        mcp->irq, err);
                return err;
        }
@@ -638,7 +640,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
 
        mcp->chip.base = pdata->base;
        mcp->chip.can_sleep = true;
-       mcp->chip.dev = dev;
+       mcp->chip.parent = dev;
        mcp->chip.owner = THIS_MODULE;
 
        /* verify MCP_IOCON.SEQOP = 0, so sequential reads work,
@@ -652,7 +654,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
        mcp->irq_controller = pdata->irq_controller;
        if (mcp->irq && mcp->irq_controller) {
                mcp->irq_active_high =
-                       of_property_read_bool(mcp->chip.dev->of_node,
+                       of_property_read_bool(mcp->chip.parent->of_node,
                                              "microchip,irq-active-high");
 
                if (type == MCP_TYPE_017)
index d3355a6dc9b1f126db770166de33f65fe1adbdbf..8942f4909a31818e92317b37f79acd0d4f2a4de8 100644 (file)
@@ -61,7 +61,7 @@ static int moxart_gpio_probe(struct platform_device *pdev)
        bgc->data = bgc->read_reg(bgc->reg_set);
        bgc->gc.base = 0;
        bgc->gc.ngpio = 32;
-       bgc->gc.dev = dev;
+       bgc->gc.parent = dev;
        bgc->gc.owner = THIS_MODULE;
 
        ret = gpiochip_add(&bgc->gc);
index 22523aae8abe597b0dacee0d63b7197288d2bd9d..fe9ef2bc981a984a440a5a15bd0b7eb0e195689e 100644 (file)
@@ -293,7 +293,7 @@ static int platform_msic_gpio_probe(struct platform_device *pdev)
        mg->chip.base = pdata->gpio_base;
        mg->chip.ngpio = MSIC_NUM_GPIO;
        mg->chip.can_sleep = true;
-       mg->chip.dev = dev;
+       mg->chip.parent = dev;
 
        mutex_init(&mg->buslock);
 
index d428b97876c52e933ee37b42540313b777c39c73..6acedf4e9b1c3080e39595ea6aa9e52db5537200 100644 (file)
@@ -698,7 +698,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 
        mvchip->soc_variant = soc_variant;
        mvchip->chip.label = dev_name(&pdev->dev);
-       mvchip->chip.dev = &pdev->dev;
+       mvchip->chip.parent = &pdev->dev;
        mvchip->chip.request = gpiochip_generic_request;
        mvchip->chip.free = gpiochip_generic_free;
        mvchip->chip.direction_input = mvebu_gpio_direction_input;
index 62ae251d4490d6e0ba101e8fa94b6eda8ec43c63..3c66ce4fe9ed0598224e57afdcb43ccbb64791fc 100644 (file)
@@ -108,7 +108,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
 
        pdev->dev.platform_data = chip;
        chip->label = "octeon-gpio";
-       chip->dev = &pdev->dev;
+       chip->parent = &pdev->dev;
        chip->owner = THIS_MODULE;
        chip->base = 0;
        chip->can_sleep = false;
index 56d2d026e62e42bf6fec7db5ad2aa25aebd970f3..7e4f7c5f999a8813ed763df1e7bc53a85817b253 100644 (file)
@@ -1090,7 +1090,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
        if (bank->is_mpuio) {
                bank->chip.label = "mpuio";
                if (bank->regs->wkup_en)
-                       bank->chip.dev = &omap_mpuio_device.dev;
+                       bank->chip.parent = &omap_mpuio_device.dev;
                bank->chip.base = OMAP_MPUIO(0);
        } else {
                bank->chip.label = "gpio";
@@ -1199,7 +1199,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
        }
 
        bank->dev = dev;
-       bank->chip.dev = dev;
+       bank->chip.parent = dev;
        bank->chip.owner = THIS_MODULE;
        bank->dbck_flag = pdata->dbck_flag;
        bank->stride = pdata->bank_stride;
index 171a6389f9ce086ffdf74f6c50523a77e205b473..5f09ed1700dc7c9020967d01b101285f9664658a 100644 (file)
@@ -54,7 +54,7 @@ static int palmas_gpio_get(struct gpio_chip *gc, unsigned offset)
 
        ret = palmas_read(palmas, PALMAS_GPIO_BASE, reg, &val);
        if (ret < 0) {
-               dev_err(gc->dev, "Reg 0x%02x read failed, %d\n", reg, ret);
+               dev_err(gc->parent, "Reg 0x%02x read failed, %d\n", reg, ret);
                return ret;
        }
 
@@ -65,7 +65,7 @@ static int palmas_gpio_get(struct gpio_chip *gc, unsigned offset)
 
        ret = palmas_read(palmas, PALMAS_GPIO_BASE, reg, &val);
        if (ret < 0) {
-               dev_err(gc->dev, "Reg 0x%02x read failed, %d\n", reg, ret);
+               dev_err(gc->parent, "Reg 0x%02x read failed, %d\n", reg, ret);
                return ret;
        }
        return !!(val & BIT(offset));
@@ -90,7 +90,7 @@ static void palmas_gpio_set(struct gpio_chip *gc, unsigned offset,
 
        ret = palmas_write(palmas, PALMAS_GPIO_BASE, reg, BIT(offset));
        if (ret < 0)
-               dev_err(gc->dev, "Reg 0x%02x write failed, %d\n", reg, ret);
+               dev_err(gc->parent, "Reg 0x%02x write failed, %d\n", reg, ret);
 }
 
 static 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,
        ret = palmas_update_bits(palmas, PALMAS_GPIO_BASE, reg,
                                BIT(offset), BIT(offset));
        if (ret < 0)
-               dev_err(gc->dev, "Reg 0x%02x update failed, %d\n", reg, ret);
+               dev_err(gc->parent, "Reg 0x%02x update failed, %d\n", reg,
+                       ret);
        return ret;
 }
 
@@ -128,7 +129,8 @@ static int palmas_gpio_input(struct gpio_chip *gc, unsigned offset)
 
        ret = palmas_update_bits(palmas, PALMAS_GPIO_BASE, reg, BIT(offset), 0);
        if (ret < 0)
-               dev_err(gc->dev, "Reg 0x%02x update failed, %d\n", reg, ret);
+               dev_err(gc->parent, "Reg 0x%02x update failed, %d\n", reg,
+                       ret);
        return ret;
 }
 
@@ -186,7 +188,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
        palmas_gpio->gpio_chip.to_irq = palmas_gpio_to_irq;
        palmas_gpio->gpio_chip.set      = palmas_gpio_set;
        palmas_gpio->gpio_chip.get      = palmas_gpio_get;
-       palmas_gpio->gpio_chip.dev = &pdev->dev;
+       palmas_gpio->gpio_chip.parent = &pdev->dev;
 #ifdef CONFIG_OF_GPIO
        palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
 #endif
index 2d4892cc70fb0c4acc149dd6a9864439644a1673..ddbbbe57eef818e63e52baffe9b70dd9daa091f2 100644 (file)
@@ -367,7 +367,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
        gc->base = chip->gpio_start;
        gc->ngpio = gpios;
        gc->label = chip->client->name;
-       gc->dev = &chip->client->dev;
+       gc->parent = &chip->client->dev;
        gc->owner = THIS_MODULE;
        gc->names = chip->names;
 }
index 1d4d9bc8b69db5cbacd1280fb5ff8c58fe25eea0..c7552106a80cd1035ce51993c67ead8db9a34501 100644 (file)
@@ -293,7 +293,7 @@ static int pcf857x_probe(struct i2c_client *client,
 
        gpio->chip.base                 = pdata ? pdata->gpio_base : -1;
        gpio->chip.can_sleep            = true;
-       gpio->chip.dev                  = &client->dev;
+       gpio->chip.parent                       = &client->dev;
        gpio->chip.owner                = THIS_MODULE;
        gpio->chip.get                  = pcf857x_get;
        gpio->chip.set                  = pcf857x_set;
index 34ed176df15a9be7ac009bfbc7e6028bb681ae15..e43db64e52b39d16bd4ed2dfa6cbb4779cd209d4 100644 (file)
@@ -220,7 +220,7 @@ static void pch_gpio_setup(struct pch_gpio *chip)
        struct gpio_chip *gpio = &chip->gpio;
 
        gpio->label = dev_name(chip->dev);
-       gpio->dev = chip->dev;
+       gpio->parent = chip->dev;
        gpio->owner = THIS_MODULE;
        gpio->direction_input = pch_gpio_direction_input;
        gpio->get = pch_gpio_get;
index 4d4b3767670220a03076301ced6b3b12cffcd265..e041639adc142afb4175a7b30b1e6ded82f417e8 100644 (file)
@@ -131,7 +131,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
        if ((trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) &&
            (trigger & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)))
        {
-               dev_err(gc->dev,
+               dev_err(gc->parent,
                        "trying to configure line %d for both level and edge "
                        "detection, choose one!\n",
                        offset);
@@ -158,7 +158,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
                else
                        gpioiev &= ~bit;
                irq_set_handler_locked(d, handle_level_irq);
-               dev_dbg(gc->dev, "line %d: IRQ on %s level\n",
+               dev_dbg(gc->parent, "line %d: IRQ on %s level\n",
                        offset,
                        polarity ? "HIGH" : "LOW");
        } 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)
                /* Select both edges, setting this makes GPIOEV be ignored */
                gpioibe |= bit;
                irq_set_handler_locked(d, handle_edge_irq);
-               dev_dbg(gc->dev, "line %d: IRQ on both edges\n", offset);
+               dev_dbg(gc->parent, "line %d: IRQ on both edges\n", offset);
        } else if ((trigger & IRQ_TYPE_EDGE_RISING) ||
                   (trigger & IRQ_TYPE_EDGE_FALLING)) {
                bool rising = trigger & IRQ_TYPE_EDGE_RISING;
@@ -182,7 +182,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
                else
                        gpioiev &= ~bit;
                irq_set_handler_locked(d, handle_edge_irq);
-               dev_dbg(gc->dev, "line %d: IRQ on %s edge\n",
+               dev_dbg(gc->parent, "line %d: IRQ on %s edge\n",
                        offset,
                        rising ? "RISING" : "FALLING");
        } else {
@@ -191,7 +191,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
                gpioibe &= ~bit;
                gpioiev &= ~bit;
                irq_set_handler_locked(d, handle_bad_irq);
-               dev_warn(gc->dev, "no trigger selected for line %d\n",
+               dev_warn(gc->parent, "no trigger selected for line %d\n",
                         offset);
        }
 
@@ -316,7 +316,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
        chip->gc.set = pl061_set_value;
        chip->gc.ngpio = PL061_GPIO_NR;
        chip->gc.label = dev_name(dev);
-       chip->gc.dev = dev;
+       chip->gc.parent = dev;
        chip->gc.owner = THIS_MODULE;
 
        ret = gpiochip_add(&chip->gc);
index 6eabf239676b689436e14255f31b675a4c37d71c..f26d9f7d8cdd967f803b61c2c3465b0f574b4d49 100644 (file)
@@ -132,7 +132,7 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
        rc5t583_gpio->gpio_chip.to_irq = rc5t583_gpio_to_irq,
        rc5t583_gpio->gpio_chip.ngpio = RC5T583_MAX_GPIO,
        rc5t583_gpio->gpio_chip.can_sleep = true,
-       rc5t583_gpio->gpio_chip.dev = &pdev->dev;
+       rc5t583_gpio->gpio_chip.parent = &pdev->dev;
        rc5t583_gpio->gpio_chip.base = -1;
        rc5t583_gpio->rc5t583 = rc5t583;
 
index 2a81224446145d62dcbd5befa1ad9e4f82ce66a7..3cbb25ecfc7a1b6a21fa3ded4a1ea45b9d6f4bc1 100644 (file)
@@ -449,7 +449,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
        gpio_chip->direction_output = gpio_rcar_direction_output;
        gpio_chip->set = gpio_rcar_set;
        gpio_chip->label = name;
-       gpio_chip->dev = dev;
+       gpio_chip->parent = dev;
        gpio_chip->owner = THIS_MODULE;
        gpio_chip->base = p->config.gpio_base;
        gpio_chip->ngpio = p->config.number_of_pins;
index b72906f5b9996ef7c1192b92ae317683070c9bb6..a8a333ade9aae981bfdadd7f2eb1ab6891401ecd 100644 (file)
@@ -171,7 +171,7 @@ static int sch_gpio_probe(struct platform_device *pdev)
        sch->iobase = res->start;
        sch->chip = sch_gpio_chip;
        sch->chip.label = dev_name(&pdev->dev);
-       sch->chip.dev = &pdev->dev;
+       sch->chip.parent = &pdev->dev;
 
        switch (pdev->id) {
        case PCI_DEVICE_ID_INTEL_SCH_LPC:
index 0cb11413e8142b977817aadb29d8b5449bc4cfe5..3841398d1078864254fa8e5cb47773dd13c3dcbf 100644 (file)
@@ -149,7 +149,7 @@ static int sch311x_gpio_request(struct gpio_chip *chip, unsigned offset)
 
        if (!request_region(block->runtime_reg + block->config_regs[offset],
                            1, DRV_NAME)) {
-               dev_err(chip->dev, "Failed to request region 0x%04x.\n",
+               dev_err(chip->parent, "Failed to request region 0x%04x.\n",
                        block->runtime_reg + block->config_regs[offset]);
                return -EBUSY;
        }
@@ -261,7 +261,7 @@ static int sch311x_gpio_probe(struct platform_device *pdev)
                block->chip.get = sch311x_gpio_get;
                block->chip.set = sch311x_gpio_set;
                block->chip.ngpio = 8;
-               block->chip.dev = &pdev->dev;
+               block->chip.parent = &pdev->dev;
                block->chip.base = sch311x_gpio_blocks[i].base;
                block->config_regs = sch311x_gpio_blocks[i].config_regs;
                block->data_reg = sch311x_gpio_blocks[i].data_reg;
index 69ffca5b073b4be16a581dc7f3286d589919bab9..bd436b7f86e113e4e6c59a668ee9e4fb5dc2c914 100644 (file)
@@ -164,7 +164,7 @@ static int spics_gpio_probe(struct platform_device *pdev)
        spics->chip.get = spics_get_value;
        spics->chip.set = spics_set_value;
        spics->chip.label = dev_name(&pdev->dev);
-       spics->chip.dev = &pdev->dev;
+       spics->chip.parent = &pdev->dev;
        spics->chip.owner = THIS_MODULE;
        spics->last_off = -1;
 
index dabfb99dddef25dabd931f4d0ad124360a92f7f7..9e471979aa9ed81cb0f246526dedf8d5753eff40 100644 (file)
@@ -356,7 +356,7 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
        stmpe_gpio->stmpe = stmpe;
        stmpe_gpio->chip = template_chip;
        stmpe_gpio->chip.ngpio = stmpe->num_gpios;
-       stmpe_gpio->chip.dev = &pdev->dev;
+       stmpe_gpio->chip.parent = &pdev->dev;
        stmpe_gpio->chip.of_node = np;
        stmpe_gpio->chip.base = -1;
 
index 81bdbe7ba2a4bce1b8e103d3b06d789b13e92e70..c250f21b9e4051e0d2c535d27e32573128625a71 100644 (file)
@@ -139,7 +139,7 @@ static int xway_stp_request(struct gpio_chip *gc, unsigned gpio)
                container_of(gc, struct xway_stp, gc);
 
        if ((gpio < 8) && (chip->reserved & BIT(gpio))) {
-               dev_err(gc->dev, "GPIO %d is driven by hardware\n", gpio);
+               dev_err(gc->parent, "GPIO %d is driven by hardware\n", gpio);
                return -ENODEV;
        }
 
@@ -214,7 +214,7 @@ static int xway_stp_probe(struct platform_device *pdev)
        if (IS_ERR(chip->virt))
                return PTR_ERR(chip->virt);
 
-       chip->gc.dev = &pdev->dev;
+       chip->gc.parent = &pdev->dev;
        chip->gc.label = "stp-xway";
        chip->gc.direction_output = xway_stp_dir_out;
        chip->gc.set = xway_stp_set;
index 76f920173a2f847cd7e370149b5d417d625ed750..c0145159a12785670664d1dc2370fcaabc14529e 100644 (file)
@@ -473,7 +473,7 @@ static void sx150x_init_chip(struct sx150x_chip *chip,
 
        chip->client                     = client;
        chip->dev_cfg                    = &sx150x_devices[driver_data];
-       chip->gpio_chip.dev              = &client->dev;
+       chip->gpio_chip.parent              = &client->dev;
        chip->gpio_chip.label            = client->name;
        chip->gpio_chip.direction_input  = sx150x_gpio_direction_input;
        chip->gpio_chip.direction_output = sx150x_gpio_direction_output;
index 045a952576c708e253de29438abaec95640989f2..cd6afee11f8421edd8c25a50e2842a17e986deb9 100644 (file)
@@ -159,7 +159,7 @@ static void keystone_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
                        BIT(offs % SYSCON_REG_BITS) | KEYSTONE_LOCK_BIT,
                        BIT(offs % SYSCON_REG_BITS) | KEYSTONE_LOCK_BIT);
        if (ret < 0)
-               dev_err(chip->dev, "gpio write failed ret(%d)\n", ret);
+               dev_err(chip->parent, "gpio write failed ret(%d)\n", ret);
 }
 
 static const struct syscon_gpio_data keystone_dsp_gpio = {
@@ -224,7 +224,7 @@ static int syscon_gpio_probe(struct platform_device *pdev)
                priv->dir_reg_offset <<= 3;
        }
 
-       priv->chip.dev = dev;
+       priv->chip.parent = dev;
        priv->chip.owner = THIS_MODULE;
        priv->chip.label = dev_name(dev);
        priv->chip.base = -1;
index 4356e6c20fc59a3792c8575417db5dfa389b3b66..1a7c3efae5d80dbf45486ebdcec804c34c203465 100644 (file)
@@ -197,7 +197,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
                return PTR_ERR(tb10x_gpio->base);
 
        tb10x_gpio->gc.label            = of_node_full_name(dn);
-       tb10x_gpio->gc.dev              = &pdev->dev;
+       tb10x_gpio->gc.parent           = &pdev->dev;
        tb10x_gpio->gc.owner            = THIS_MODULE;
        tb10x_gpio->gc.direction_input  = tb10x_gpio_direction_in;
        tb10x_gpio->gc.get              = tb10x_gpio_get;
index d1d585ddb9ab786b2813993de448a3f3b50ab0c5..7c1537ed6dff60156805dbe4b4c29cb4fbc197b6 100644 (file)
@@ -258,7 +258,7 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 
        tc3589x_gpio->chip = template_chip;
        tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
-       tc3589x_gpio->chip.dev = &pdev->dev;
+       tc3589x_gpio->chip.parent = &pdev->dev;
        tc3589x_gpio->chip.base = -1;
        tc3589x_gpio->chip.of_node = np;
 
index 30653e6319e9899cd2bd2e36ff5e00b0261dda62..dda8f21811ebd5c0744e9584aad8f923bd58af8f 100644 (file)
@@ -268,7 +268,7 @@ static int timbgpio_probe(struct platform_device *pdev)
 
        gc->label = dev_name(&pdev->dev);
        gc->owner = THIS_MODULE;
-       gc->dev = &pdev->dev;
+       gc->parent = &pdev->dev;
        gc->direction_input = timbgpio_gpio_direction_input;
        gc->get = timbgpio_gpio_get;
        gc->direction_output = timbgpio_gpio_direction_output;
index 9c9238e838a95eb6fe7982974b1a4889966544bc..89b2249100b02424c1adb20334b45f7bd72a879e 100644 (file)
@@ -104,7 +104,7 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 
        tps6586x_gpio->gpio_chip.owner = THIS_MODULE;
        tps6586x_gpio->gpio_chip.label = pdev->name;
-       tps6586x_gpio->gpio_chip.dev = &pdev->dev;
+       tps6586x_gpio->gpio_chip.parent = &pdev->dev;
        tps6586x_gpio->gpio_chip.ngpio = 4;
        tps6586x_gpio->gpio_chip.can_sleep = true;
 
index 88f1f5ff4e966a7ab918b102f33eb6c1857b5c62..83894c0387fbef1e880b02d00a2ba8828a9dc88d 100644 (file)
@@ -146,7 +146,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
        tps65910_gpio->gpio_chip.direction_output = tps65910_gpio_output;
        tps65910_gpio->gpio_chip.set    = tps65910_gpio_set;
        tps65910_gpio->gpio_chip.get    = tps65910_gpio_get;
-       tps65910_gpio->gpio_chip.dev = &pdev->dev;
+       tps65910_gpio->gpio_chip.parent = &pdev->dev;
 #ifdef CONFIG_OF_GPIO
        tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node;
 #endif
index 9cdbc0c9cb2da87abc65dda442fc75a1612cc51e..0f073ffa74cf5a1811f546f8327c13baa50ab558 100644 (file)
@@ -104,7 +104,7 @@ static int tps65912_gpio_probe(struct platform_device *pdev)
 
        tps65912_gpio->tps65912 = tps65912;
        tps65912_gpio->gpio_chip = template_chip;
-       tps65912_gpio->gpio_chip.dev = &pdev->dev;
+       tps65912_gpio->gpio_chip.parent = &pdev->dev;
        if (pdata && pdata->gpio_base)
                tps65912_gpio->gpio_chip.base = pdata->gpio_base;
 
index b29a102d136b0a30d20bf234c8a0776d4749a980..aafe7910e030bdbf63d640e73a57c7c5e8cbf998 100644 (file)
@@ -315,7 +315,8 @@ static void ts5500_disable_irq(struct ts5500_priv *priv)
        else if (priv->hwirq == 1)
                ts5500_clear_mask(BIT(6), 0x7d); /* LCD_RS on IRQ1 */
        else
-               dev_err(priv->gpio_chip.dev, "invalid hwirq %d\n", priv->hwirq);
+               dev_err(priv->gpio_chip.parent, "invalid hwirq %d\n",
+                       priv->hwirq);
        spin_unlock_irqrestore(&priv->lock, flags);
 }
 
@@ -346,7 +347,7 @@ static int ts5500_dio_probe(struct platform_device *pdev)
 
        priv->gpio_chip.owner = THIS_MODULE;
        priv->gpio_chip.label = name;
-       priv->gpio_chip.dev = dev;
+       priv->gpio_chip.parent = dev;
        priv->gpio_chip.direction_input = ts5500_gpio_input;
        priv->gpio_chip.direction_output = ts5500_gpio_output;
        priv->gpio_chip.get = ts5500_gpio_get;
index 9e1dbb9877c1ac1a5ffd5fb1b83bfa5d7399b5c9..14f40bf64e34f69d845a0d24efe9d433b2d79ad6 100644 (file)
@@ -256,7 +256,7 @@ static int twl_request(struct gpio_chip *chip, unsigned offset)
                /* optionally have the first two GPIOs switch vMMC1
                 * and vMMC2 power supplies based on card presence.
                 */
-               pdata = dev_get_platdata(chip->dev);
+               pdata = dev_get_platdata(chip->parent);
                if (pdata)
                        value |= pdata->mmc_cd & 0x03;
 
@@ -509,7 +509,7 @@ no_irqs:
        priv->gpio_chip = template_chip;
        priv->gpio_chip.base = -1;
        priv->gpio_chip.ngpio = TWL4030_GPIO_MAX;
-       priv->gpio_chip.dev = &pdev->dev;
+       priv->gpio_chip.parent = &pdev->dev;
 
        mutex_init(&priv->mutex);
 
index c946e7eef3ee75f7c1d0e9cf183ee8f5e03999a6..2da7c5f70034cd9970e15adec19636d0449771e0 100644 (file)
@@ -36,7 +36,7 @@ static struct gpio_chip twl6040gpo_chip;
 
 static int twl6040gpo_get(struct gpio_chip *chip, unsigned offset)
 {
-       struct twl6040 *twl6040 = dev_get_drvdata(chip->dev->parent);
+       struct twl6040 *twl6040 = dev_get_drvdata(chip->parent->parent);
        int ret = 0;
 
        ret = twl6040_reg_read(twl6040, TWL6040_REG_GPOCTL);
@@ -55,7 +55,7 @@ static int twl6040gpo_direction_out(struct gpio_chip *chip, unsigned offset,
 
 static void twl6040gpo_set(struct gpio_chip *chip, unsigned offset, int value)
 {
-       struct twl6040 *twl6040 = dev_get_drvdata(chip->dev->parent);
+       struct twl6040 *twl6040 = dev_get_drvdata(chip->parent->parent);
        int ret;
        u8 gpoctl;
 
@@ -95,7 +95,7 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
        else
                twl6040gpo_chip.ngpio = 1; /* twl6041 have 1 GPO */
 
-       twl6040gpo_chip.dev = &pdev->dev;
+       twl6040gpo_chip.parent = &pdev->dev;
 #ifdef CONFIG_OF_GPIO
        twl6040gpo_chip.of_node = twl6040_core_dev->of_node;
 #endif
index 3623d009d8087fc6d1fc1538c732b260e36709de..a974397164b247b2b3982b212716bf8f9907d0d6 100644 (file)
@@ -188,7 +188,7 @@ static int tz1090_pdc_gpio_probe(struct platform_device *pdev)
 
        /* Set up GPIO chip */
        priv->chip.label                = "tz1090-pdc-gpio";
-       priv->chip.dev                  = &pdev->dev;
+       priv->chip.parent                       = &pdev->dev;
        priv->chip.direction_input      = tz1090_pdc_gpio_direction_input;
        priv->chip.direction_output     = tz1090_pdc_gpio_direction_output;
        priv->chip.get                  = tz1090_pdc_gpio_get;
index 87bb1b1eee8deacaa4f9cdb9ccc81166025393e5..7858d90202f315b11694eab500c3f3e4d550aa26 100644 (file)
@@ -425,7 +425,7 @@ static int tz1090_gpio_bank_probe(struct tz1090_gpio_bank_info *info)
        snprintf(bank->label, sizeof(bank->label), "tz1090-gpio-%u",
                 info->index);
        bank->chip.label                = bank->label;
-       bank->chip.dev                  = dev;
+       bank->chip.parent                       = dev;
        bank->chip.direction_input      = tz1090_gpio_direction_input;
        bank->chip.direction_output     = tz1090_gpio_direction_output;
        bank->chip.get                  = tz1090_gpio_get;
index 87b950cec6ec929689a3d52b428f9224acebc623..9031e60c815c237f80c7ba2bebfa23a04ee1f930 100644 (file)
@@ -249,7 +249,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 
        gc = &port->gc;
        gc->of_node = np;
-       gc->dev = dev;
+       gc->parent = dev;
        gc->label = "vf610-gpio";
        gc->ngpio = VF610_GPIO_PER_PORT;
        gc->base = of_alias_get_id(np, "gpio") * VF610_GPIO_PER_PORT;
index e2a11f27807fcd0b23b7c0ecfc11d5690466edfa..26e7edb74f420909f1effc2190f7c1f48954bbdf 100644 (file)
@@ -173,7 +173,7 @@ static void vprbrd_gpioa_set(struct gpio_chip *chip,
                mutex_unlock(&vb->lock);
 
                if (ret != sizeof(struct vprbrd_gpioa_msg))
-                       dev_err(chip->dev, "usb error setting pin value\n");
+                       dev_err(chip->parent, "usb error setting pin value\n");
        }
 }
 
@@ -345,7 +345,7 @@ static void vprbrd_gpiob_set(struct gpio_chip *chip,
                mutex_unlock(&vb->lock);
 
                if (ret != sizeof(struct vprbrd_gpiob_msg))
-                       dev_err(chip->dev, "usb error setting pin value\n");
+                       dev_err(chip->parent, "usb error setting pin value\n");
        }
 }
 
@@ -366,7 +366,7 @@ static int vprbrd_gpiob_direction_input(struct gpio_chip *chip,
        mutex_unlock(&vb->lock);
 
        if (ret)
-               dev_err(chip->dev, "usb error setting pin to input\n");
+               dev_err(chip->parent, "usb error setting pin to input\n");
 
        return ret;
 }
@@ -385,7 +385,7 @@ static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
 
        ret = vprbrd_gpiob_setdir(vb, offset, 1);
        if (ret)
-               dev_err(chip->dev, "usb error setting pin to output\n");
+               dev_err(chip->parent, "usb error setting pin to output\n");
 
        mutex_unlock(&vb->lock);
 
@@ -409,7 +409,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
        vb_gpio->vb = vb;
        /* registering gpio a */
        vb_gpio->gpioa.label = "viperboard gpio a";
-       vb_gpio->gpioa.dev = &pdev->dev;
+       vb_gpio->gpioa.parent = &pdev->dev;
        vb_gpio->gpioa.owner = THIS_MODULE;
        vb_gpio->gpioa.base = -1;
        vb_gpio->gpioa.ngpio = 16;
@@ -420,13 +420,13 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
        vb_gpio->gpioa.direction_output = vprbrd_gpioa_direction_output;
        ret = gpiochip_add(&vb_gpio->gpioa);
        if (ret < 0) {
-               dev_err(vb_gpio->gpioa.dev, "could not add gpio a");
+               dev_err(vb_gpio->gpioa.parent, "could not add gpio a");
                goto err_gpioa;
        }
 
        /* registering gpio b */
        vb_gpio->gpiob.label = "viperboard gpio b";
-       vb_gpio->gpiob.dev = &pdev->dev;
+       vb_gpio->gpiob.parent = &pdev->dev;
        vb_gpio->gpiob.owner = THIS_MODULE;
        vb_gpio->gpiob.base = -1;
        vb_gpio->gpiob.ngpio = 16;
@@ -437,7 +437,7 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
        vb_gpio->gpiob.direction_output = vprbrd_gpiob_direction_output;
        ret = gpiochip_add(&vb_gpio->gpiob);
        if (ret < 0) {
-               dev_err(vb_gpio->gpiob.dev, "could not add gpio b");
+               dev_err(vb_gpio->gpiob.parent, "could not add gpio b");
                goto err_gpiob;
        }
 
index c1caa459c02da527f580f6b8445fdf4df28ce383..1947531b7cf5ee36eb87ae785f1ea039cbf24885 100644 (file)
@@ -139,7 +139,7 @@ static void unmask_giuint_low(struct irq_data *d)
 static unsigned int startup_giuint(struct irq_data *data)
 {
        if (gpiochip_lock_as_irq(&vr41xx_gpio_chip, data->hwirq))
-               dev_err(vr41xx_gpio_chip.dev,
+               dev_err(vr41xx_gpio_chip.parent,
                        "unable to lock HW IRQ %lu for IRQ\n",
                        data->hwirq);
        /* Satisfy the .enable semantics by unmasking the line */
@@ -542,7 +542,7 @@ static int giu_probe(struct platform_device *pdev)
        if (!giu_base)
                return -ENOMEM;
 
-       vr41xx_gpio_chip.dev = &pdev->dev;
+       vr41xx_gpio_chip.parent = &pdev->dev;
 
        ret = gpiochip_add(&vr41xx_gpio_chip);
        if (!ret) {
index 58ce75c188b71106a86d19ff49f429cee2c57115..2e73e4b52c6982e2f7885fd289afdbc8abf160fe 100644 (file)
@@ -258,7 +258,7 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
        wm831x_gpio->wm831x = wm831x;
        wm831x_gpio->gpio_chip = template_chip;
        wm831x_gpio->gpio_chip.ngpio = wm831x->num_gpio;
-       wm831x_gpio->gpio_chip.dev = &pdev->dev;
+       wm831x_gpio->gpio_chip.parent = &pdev->dev;
        if (pdata && pdata->gpio_base)
                wm831x_gpio->gpio_chip.base = pdata->gpio_base;
        else
index 060b89303bb6125e28919a4c31f032adf6d7ed0a..1e3d8da61ff34b0ce609478b19b0bb2e9b85f5c6 100644 (file)
@@ -124,7 +124,7 @@ static int wm8350_gpio_probe(struct platform_device *pdev)
        wm8350_gpio->wm8350 = wm8350;
        wm8350_gpio->gpio_chip = template_chip;
        wm8350_gpio->gpio_chip.ngpio = 13;
-       wm8350_gpio->gpio_chip.dev = &pdev->dev;
+       wm8350_gpio->gpio_chip.parent = &pdev->dev;
        if (pdata && pdata->gpio_base)
                wm8350_gpio->gpio_chip.base = pdata->gpio_base;
        else
index 6f5e42db4b9e30f8a4254b3c68b66cd6d2a5b206..de73c80163c126678182e2ce8895355a57926dcb 100644 (file)
@@ -260,7 +260,7 @@ static int wm8994_gpio_probe(struct platform_device *pdev)
        wm8994_gpio->wm8994 = wm8994;
        wm8994_gpio->gpio_chip = template_chip;
        wm8994_gpio->gpio_chip.ngpio = WM8994_GPIO_MAX;
-       wm8994_gpio->gpio_chip.dev = &pdev->dev;
+       wm8994_gpio->gpio_chip.parent = &pdev->dev;
        if (pdata && pdata->gpio_base)
                wm8994_gpio->gpio_chip.base = pdata->gpio_base;
        else
index 18a8182d4fec291f569233935ad0472517aefdb8..b8ceb71885f6b0151547fae3f753fb7a247191ba 100644 (file)
@@ -188,7 +188,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
        gpio->chip.ngpio = XGENE_MAX_GPIOS;
 
        spin_lock_init(&gpio->lock);
-       gpio->chip.dev = &pdev->dev;
+       gpio->chip.parent = &pdev->dev;
        gpio->chip.direction_input = xgene_gpio_dir_in;
        gpio->chip.direction_output = xgene_gpio_dir_out;
        gpio->chip.get = xgene_gpio_get;
index d5284dfe01fe167e9da6c6c4f8342d67d8380b20..5c2971e1cb08fc0a6b37e0c2622acfa39cce82ef 100644 (file)
@@ -305,7 +305,7 @@ static int xgpio_probe(struct platform_device *pdev)
        }
 
        chip->mmchip.gc.ngpio = chip->gpio_width[0] + chip->gpio_width[1];
-       chip->mmchip.gc.dev = &pdev->dev;
+       chip->mmchip.gc.parent = &pdev->dev;
        chip->mmchip.gc.direction_input = xgpio_dir_in;
        chip->mmchip.gc.direction_output = xgpio_dir_out;
        chip->mmchip.gc.get = xgpio_get;
index bc06a2cd2c1d6663add40cec337953feebcb443c..3f31aac2ba3c5aad8e8ba13ee87c65e0fb20fb9e 100644 (file)
@@ -373,7 +373,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
        gc->owner = THIS_MODULE;
        gc->label = dev_name(&pdev->dev);
        gc->base = 0;
-       gc->dev = &pdev->dev;
+       gc->parent = &pdev->dev;
        gc->ngpio = ngpio;
        gc->of_node = pdev->dev.of_node;
        gc->direction_output = xlp_gpio_dir_output;
index 6f02d7c4cc57e964b916738a47a5647d95e33bfc..65b61dcc6268dd25512c9971fa64e1c5d413b4d0 100644 (file)
@@ -185,7 +185,7 @@ static int zevio_gpio_probe(struct platform_device *pdev)
 
        /* Copy our reference */
        controller->chip.gc = zevio_gpio_chip;
-       controller->chip.gc.dev = &pdev->dev;
+       controller->chip.gc.parent = &pdev->dev;
 
        status = of_mm_gpiochip_add(pdev->dev.of_node, &(controller->chip));
        if (status) {
@@ -199,7 +199,7 @@ static int zevio_gpio_probe(struct platform_device *pdev)
        for (i = 0; i < controller->chip.gc.ngpio; i += 8)
                zevio_gpio_port_set(controller, i, ZEVIO_GPIO_INT_MASK, 0xFF);
 
-       dev_dbg(controller->chip.gc.dev, "ZEVIO GPIO controller set up!\n");
+       dev_dbg(controller->chip.gc.parent, "ZEVIO GPIO controller set up!\n");
 
        return 0;
 }
index 1dcf7a66dd36ed62eda1cf2bb4b4a867a29b89c5..ab2e54fa46cfff567405608914c9c3643d771889 100644 (file)
@@ -245,7 +245,7 @@ static int zx_gpio_probe(struct platform_device *pdev)
        chip->gc.base = ZX_GPIO_NR * id;
        chip->gc.ngpio = ZX_GPIO_NR;
        chip->gc.label = dev_name(dev);
-       chip->gc.dev = dev;
+       chip->gc.parent = dev;
        chip->gc.owner = THIS_MODULE;
 
        ret = gpiochip_add(&chip->gc);
index 8abeacac588579c16eaf7e537f7da96b44b2d490..8a04e00bef32c2f018ce20e6f0e240c98712b3f5 100644 (file)
@@ -592,7 +592,7 @@ static int zynq_gpio_request(struct gpio_chip *chip, unsigned offset)
 {
        int ret;
 
-       ret = pm_runtime_get_sync(chip->dev);
+       ret = pm_runtime_get_sync(chip->parent);
 
        /*
         * 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)
 
 static void zynq_gpio_free(struct gpio_chip *chip, unsigned offset)
 {
-       pm_runtime_put(chip->dev);
+       pm_runtime_put(chip->parent);
 }
 
 static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
@@ -698,7 +698,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
        chip = &gpio->chip;
        chip->label = gpio->p_data->label;
        chip->owner = THIS_MODULE;
-       chip->dev = &pdev->dev;
+       chip->parent = &pdev->dev;
        chip->get = zynq_gpio_get_value;
        chip->set = zynq_gpio_set_value;
        chip->request = zynq_gpio_request;
index 16a7b68167444bba93e24d3d59769f0a08d55440..e4620e14457f5860272bb12fe72dacbbf7883b76 100644 (file)
@@ -51,10 +51,10 @@ struct acpi_gpio_chip {
 
 static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
 {
-       if (!gc->dev)
+       if (!gc->parent)
                return false;
 
-       return ACPI_HANDLE(gc->dev) == data;
+       return ACPI_HANDLE(gc->parent) == data;
 }
 
 #ifdef CONFIG_PINCTRL
@@ -184,7 +184,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
        if (agpio->connection_type != ACPI_RESOURCE_GPIO_TYPE_INT)
                return AE_OK;
 
-       handle = ACPI_HANDLE(chip->dev);
+       handle = ACPI_HANDLE(chip->parent);
        pin = agpio->pin_table[0];
 
        if (pin <= 255) {
@@ -208,7 +208,7 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
 
        desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event");
        if (IS_ERR(desc)) {
-               dev_err(chip->dev, "Failed to request GPIO\n");
+               dev_err(chip->parent, "Failed to request GPIO\n");
                return AE_ERROR;
        }
 
@@ -216,13 +216,13 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
 
        ret = gpiochip_lock_as_irq(chip, pin);
        if (ret) {
-               dev_err(chip->dev, "Failed to lock GPIO as interrupt\n");
+               dev_err(chip->parent, "Failed to lock GPIO as interrupt\n");
                goto fail_free_desc;
        }
 
        irq = gpiod_to_irq(desc);
        if (irq < 0) {
-               dev_err(chip->dev, "Failed to translate GPIO to IRQ\n");
+               dev_err(chip->parent, "Failed to translate GPIO to IRQ\n");
                goto fail_unlock_irq;
        }
 
@@ -259,7 +259,8 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
        ret = request_threaded_irq(event->irq, NULL, handler, irqflags,
                                   "ACPI:Event", event);
        if (ret) {
-               dev_err(chip->dev, "Failed to setup interrupt handler for %d\n",
+               dev_err(chip->parent,
+                       "Failed to setup interrupt handler for %d\n",
                        event->irq);
                goto fail_free_event;
        }
@@ -293,10 +294,10 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip)
        acpi_handle handle;
        acpi_status status;
 
-       if (!chip->dev || !chip->to_irq)
+       if (!chip->parent || !chip->to_irq)
                return;
 
-       handle = ACPI_HANDLE(chip->dev);
+       handle = ACPI_HANDLE(chip->parent);
        if (!handle)
                return;
 
@@ -323,10 +324,10 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
        acpi_handle handle;
        acpi_status status;
 
-       if (!chip->dev || !chip->to_irq)
+       if (!chip->parent || !chip->to_irq)
                return;
 
-       handle = ACPI_HANDLE(chip->dev);
+       handle = ACPI_HANDLE(chip->parent);
        if (!handle)
                return;
 
@@ -748,7 +749,7 @@ out:
 static void acpi_gpiochip_request_regions(struct acpi_gpio_chip *achip)
 {
        struct gpio_chip *chip = achip->chip;
-       acpi_handle handle = ACPI_HANDLE(chip->dev);
+       acpi_handle handle = ACPI_HANDLE(chip->parent);
        acpi_status status;
 
        INIT_LIST_HEAD(&achip->conns);
@@ -757,20 +758,22 @@ static void acpi_gpiochip_request_regions(struct acpi_gpio_chip *achip)
                                                    acpi_gpio_adr_space_handler,
                                                    NULL, achip);
        if (ACPI_FAILURE(status))
-               dev_err(chip->dev, "Failed to install GPIO OpRegion handler\n");
+               dev_err(chip->parent,
+                       "Failed to install GPIO OpRegion handler\n");
 }
 
 static void acpi_gpiochip_free_regions(struct acpi_gpio_chip *achip)
 {
        struct gpio_chip *chip = achip->chip;
-       acpi_handle handle = ACPI_HANDLE(chip->dev);
+       acpi_handle handle = ACPI_HANDLE(chip->parent);
        struct acpi_gpio_connection *conn, *tmp;
        acpi_status status;
 
        status = acpi_remove_address_space_handler(handle, ACPI_ADR_SPACE_GPIO,
                                                   acpi_gpio_adr_space_handler);
        if (ACPI_FAILURE(status)) {
-               dev_err(chip->dev, "Failed to remove GPIO OpRegion handler\n");
+               dev_err(chip->parent,
+                       "Failed to remove GPIO OpRegion handler\n");
                return;
        }
 
@@ -787,16 +790,16 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
        acpi_handle handle;
        acpi_status status;
 
-       if (!chip || !chip->dev)
+       if (!chip || !chip->parent)
                return;
 
-       handle = ACPI_HANDLE(chip->dev);
+       handle = ACPI_HANDLE(chip->parent);
        if (!handle)
                return;
 
        acpi_gpio = kzalloc(sizeof(*acpi_gpio), GFP_KERNEL);
        if (!acpi_gpio) {
-               dev_err(chip->dev,
+               dev_err(chip->parent,
                        "Failed to allocate memory for ACPI GPIO chip\n");
                return;
        }
@@ -806,7 +809,7 @@ void acpi_gpiochip_add(struct gpio_chip *chip)
 
        status = acpi_attach_data(handle, acpi_gpio_chip_dh, acpi_gpio);
        if (ACPI_FAILURE(status)) {
-               dev_err(chip->dev, "Failed to attach ACPI GPIO chip\n");
+               dev_err(chip->parent, "Failed to attach ACPI GPIO chip\n");
                kfree(acpi_gpio);
                return;
        }
@@ -820,16 +823,16 @@ void acpi_gpiochip_remove(struct gpio_chip *chip)
        acpi_handle handle;
        acpi_status status;
 
-       if (!chip || !chip->dev)
+       if (!chip || !chip->parent)
                return;
 
-       handle = ACPI_HANDLE(chip->dev);
+       handle = ACPI_HANDLE(chip->parent);
        if (!handle)
                return;
 
        status = acpi_get_data(handle, acpi_gpio_chip_dh, (void **)&acpi_gpio);
        if (ACPI_FAILURE(status)) {
-               dev_warn(chip->dev, "Failed to retrieve ACPI GPIO chip\n");
+               dev_warn(chip->parent, "Failed to retrieve ACPI GPIO chip\n");
                return;
        }
 
index 5fe34a9df3e6b8538ddc47a8ec6008654c89d89c..6ed465ea2e12bf934698505d76c54379fc6d3e5d 100644 (file)
@@ -423,8 +423,8 @@ int of_gpiochip_add(struct gpio_chip *chip)
 {
        int status;
 
-       if ((!chip->of_node) && (chip->dev))
-               chip->of_node = chip->dev->of_node;
+       if ((!chip->of_node) && (chip->parent))
+               chip->of_node = chip->parent->of_node;
 
        if (!chip->of_node)
                return 0;
index b57ed8e55ab5f61b7f8307399bb4e3d16299e64b..405dfcaadc4cf688d9cb8c4277f561031fe67f0f 100644 (file)
@@ -605,7 +605,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
        if (chip->names && chip->names[offset])
                ioname = chip->names[offset];
 
-       dev = device_create_with_groups(&gpio_class, chip->dev,
+       dev = device_create_with_groups(&gpio_class, chip->parent,
                                        MKDEV(0, 0), data, gpio_groups,
                                        ioname ? ioname : "gpio%u",
                                        desc_to_gpio(desc));
@@ -730,7 +730,8 @@ int gpiochip_sysfs_register(struct gpio_chip *chip)
                return 0;
 
        /* use chip->base for the ID; it's already known to be unique */
-       dev = device_create_with_groups(&gpio_class, chip->dev, MKDEV(0, 0),
+       dev = device_create_with_groups(&gpio_class, chip->parent,
+                                       MKDEV(0, 0),
                                        chip, gpiochip_groups,
                                        "gpiochip%d", chip->base);
        if (IS_ERR(dev))
index a18f00fc1bb87544cc59182e6f4a5515464a2f29..8b35457013dac2160af0b08da3619bff6fbccdc1 100644 (file)
@@ -205,8 +205,8 @@ static int gpiochip_add_to_list(struct gpio_chip *chip)
        if (pos != &gpio_chips && pos->prev != &gpio_chips) {
                _chip = list_entry(pos->prev, struct gpio_chip, list);
                if (_chip->base + _chip->ngpio > chip->base) {
-                       dev_err(chip->dev,
-                              "GPIO integer space overlap, cannot add chip\n");
+                       dev_err(chip->parent,
+                               "GPIO integer space overlap, cannot add chip\n");
                        err = -EBUSY;
                }
        }
@@ -267,7 +267,7 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
 
                gpio = gpio_name_to_desc(gc->names[i]);
                if (gpio)
-                       dev_warn(gc->dev, "Detected name collision for "
+                       dev_warn(gc->parent, "Detected name collision for "
                                 "GPIO name '%s'\n",
                                 gc->names[i]);
        }
@@ -348,8 +348,8 @@ int gpiochip_add(struct gpio_chip *chip)
        INIT_LIST_HEAD(&chip->pin_ranges);
 #endif
 
-       if (!chip->owner && chip->dev && chip->dev->driver)
-               chip->owner = chip->dev->driver->owner;
+       if (!chip->owner && chip->parent && chip->parent->driver)
+               chip->owner = chip->parent->driver->owner;
 
        status = gpiochip_set_desc_names(chip);
        if (status)
@@ -424,7 +424,8 @@ void gpiochip_remove(struct gpio_chip *chip)
        spin_unlock_irqrestore(&gpio_lock, flags);
 
        if (requested)
-               dev_crit(chip->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n");
+               dev_crit(chip->parent,
+                        "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n");
 
        kfree(chip->desc);
        chip->desc = NULL;
@@ -683,11 +684,11 @@ int _gpiochip_irqchip_add(struct gpio_chip *gpiochip,
        if (!gpiochip || !irqchip)
                return -EINVAL;
 
-       if (!gpiochip->dev) {
+       if (!gpiochip->parent) {
                pr_err("missing gpiochip .dev parent pointer\n");
                return -EINVAL;
        }
-       of_node = gpiochip->dev->of_node;
+       of_node = gpiochip->parent->of_node;
 #ifdef CONFIG_OF_GPIO
        /*
         * 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)
 
        seq_printf(s, "%sGPIOs %d-%d", (char *)s->private,
                        chip->base, chip->base + chip->ngpio - 1);
-       dev = chip->dev;
+       dev = chip->parent;
        if (dev)
                seq_printf(s, ", %s/%s", dev->bus ? dev->bus->name : "no-bus",
                        dev_name(dev));
index 7afc3fcc122c476a42e20f1e85e1ed409c93a734..f47954e8fd2cc92dbe28a19a800eb21dbd725498 100644 (file)
@@ -1104,7 +1104,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
        dev->gc.base                    = -1;
        dev->gc.ngpio                   = 8;
        dev->gc.can_sleep               = 1;
-       dev->gc.dev                     = &hdev->dev;
+       dev->gc.parent                  = &hdev->dev;
 
        ret = gpiochip_add(&dev->gc);
        if (ret < 0) {
index fec66ad805133d1ae1543bc8ecda10a5382167e9..16b5cc2196f2f1649342a9e945084a231d304ae0 100644 (file)
@@ -454,7 +454,7 @@ static int ad7879_gpio_add(struct ad7879 *ts,
                ts->gc.ngpio = 1;
                ts->gc.label = "AD7879-GPIO";
                ts->gc.owner = THIS_MODULE;
-               ts->gc.dev = ts->dev;
+               ts->gc.parent = ts->dev;
 
                ret = gpiochip_add(&ts->gc);
                if (ret)
index 5a6363d161a2f91e203a58923a3b09cc26a980b9..a975b32ee8c8dca8e84e0e6e3ae61f8852e63d98 100644 (file)
@@ -319,7 +319,7 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs)
        }
 
 #ifdef CONFIG_LEDS_PCA9532_GPIO
-       if (data->gpio.dev)
+       if (data->gpio.parent)
                gpiochip_remove(&data->gpio);
 #endif
 
@@ -413,13 +413,13 @@ static int pca9532_configure(struct i2c_client *client,
                data->gpio.can_sleep = 1;
                data->gpio.base = pdata->gpio_base;
                data->gpio.ngpio = data->chip_info->num_leds;
-               data->gpio.dev = &client->dev;
+               data->gpio.parent = &client->dev;
                data->gpio.owner = THIS_MODULE;
 
                err = gpiochip_add(&data->gpio);
                if (err) {
                        /* Use data->gpio.dev as a flag for freeing gpiochip */
-                       data->gpio.dev = NULL;
+                       data->gpio.parent = NULL;
                        dev_warn(&client->dev, "could not add gpiochip\n");
                } else {
                        dev_info(&client->dev, "gpios %i...%i\n",
index edbecc4ca2da4c2df887e56c34fcee33c88ca847..75529a24a61525d5705b1d2b4c37e6da48a1788b 100644 (file)
@@ -651,7 +651,7 @@ static int tca6507_probe_gpios(struct i2c_client *client,
        tca->gpio.owner = THIS_MODULE;
        tca->gpio.direction_output = tca6507_gpio_direction_output;
        tca->gpio.set = tca6507_gpio_set_value;
-       tca->gpio.dev = &client->dev;
+       tca->gpio.parent = &client->dev;
 #ifdef CONFIG_OF_GPIO
        tca->gpio.of_node = of_node_get(client->dev.of_node);
 #endif
index def6d21d1445b9135acdd416aac248125c599833..24a457d9d803372dd25ced70284bdab381c0d2f5 100644 (file)
@@ -722,7 +722,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
 #ifdef CONFIG_GPIOLIB
                /* add GPIOs */
                priv->gpio_chip.label = KBUILD_MODNAME;
-               priv->gpio_chip.dev = &priv->i2c->dev;
+               priv->gpio_chip.parent = &priv->i2c->dev;
                priv->gpio_chip.owner = THIS_MODULE;
                priv->gpio_chip.direction_output =
                                cxd2820r_gpio_direction_output;
index 4c826f78acd020362a5e666432df13c9e19788bf..bc90efe01b59e36df6104cdd8dbde1721aefe46e 100644 (file)
@@ -259,7 +259,7 @@ static int add_children(struct i2c_client *client)
        int             i;
 
        /* GPIO-ish stuff */
-       dm355evm_msp_gpio.dev = &client->dev;
+       dm355evm_msp_gpio.parent = &client->dev;
        status = gpiochip_add(&dm355evm_msp_gpio);
        if (status < 0)
                return status;
index 6ccaf90d98fd6e1020da79583c076591d683342b..d334e7d8a77d523f04816c371558b8a098ad1dde 100644 (file)
@@ -321,7 +321,7 @@ static int __init egpio_probe(struct platform_device *pdev)
                ei->chip[i].dev = &(pdev->dev);
                chip = &(ei->chip[i].chip);
                chip->label           = "htc-egpio";
-               chip->dev             = &pdev->dev;
+               chip->parent          = &pdev->dev;
                chip->owner           = THIS_MODULE;
                chip->get             = egpio_get;
                chip->set             = egpio_set;
index 0c6ff727b2ec97895a83cfaf19d0fd98dfa170af..bd6b96d07ab84fd0dd2722a496ba1223d564e7d3 100644 (file)
@@ -429,7 +429,7 @@ static int htcpld_register_chip_gpio(
        /* Setup the GPIO chips */
        gpio_chip = &(chip->chip_out);
        gpio_chip->label           = "htcpld-out";
-       gpio_chip->dev             = dev;
+       gpio_chip->parent             = dev;
        gpio_chip->owner           = THIS_MODULE;
        gpio_chip->get             = htcpld_chip_get;
        gpio_chip->set             = htcpld_chip_set;
@@ -440,7 +440,7 @@ static int htcpld_register_chip_gpio(
 
        gpio_chip = &(chip->chip_in);
        gpio_chip->label           = "htcpld-in";
-       gpio_chip->dev             = dev;
+       gpio_chip->parent             = dev;
        gpio_chip->owner           = THIS_MODULE;
        gpio_chip->get             = htcpld_chip_get;
        gpio_chip->set             = NULL;
index 448f0a182dc4562d19bb35f9952b96124dcd37d7..b96847491277d3cd21ee42a0a7ba3a0b1bf7c27c 100644 (file)
@@ -638,7 +638,7 @@ static int tps65010_probe(struct i2c_client *client,
                tps->outmask = board->outmask;
 
                tps->chip.label = client->name;
-               tps->chip.dev = &client->dev;
+               tps->chip.parent = &client->dev;
                tps->chip.owner = THIS_MODULE;
 
                tps->chip.set = tps65010_gpio_set;
index f691d7ecad526c7acf07272e49a9cc001737bf58..a6ec7cc0fac6667ed026bff03dcb2e399f56847f 100644 (file)
@@ -570,7 +570,7 @@ static int ucb1x00_probe(struct mcp *mcp)
 
        if (pdata && pdata->gpio_base) {
                ucb->gpio.label = dev_name(&ucb->dev);
-               ucb->gpio.dev = &ucb->dev;
+               ucb->gpio.parent = &ucb->dev;
                ucb->gpio.owner = THIS_MODULE;
                ucb->gpio.base = pdata->gpio_base;
                ucb->gpio.ngpio = 10;
index a1ea565fcd46490e58d48e4363318c2ce6970ebc..0bc1abcedbae9dfa50559e1c52b46f560a05ad34 100644 (file)
@@ -337,7 +337,7 @@ static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 
 static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
-       struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
+       struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent);
 
        return bcm2835_gpio_get_bit(pc, GPLEV0, offset);
 }
@@ -350,14 +350,14 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
 
 static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 {
-       struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
+       struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent);
 
        bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
 }
 
 static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
-       struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
+       struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->parent);
 
        return irq_linear_revmap(pc->irq_domain, offset);
 }
@@ -963,7 +963,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
                return PTR_ERR(pc->base);
 
        pc->gpio_chip = bcm2835_gpio_chip;
-       pc->gpio_chip.dev = dev;
+       pc->gpio_chip.parent = dev;
        pc->gpio_chip.of_node = np;
 
        pc->irq_domain = irq_domain_add_linear(np, BCM2835_NUM_GPIOS,
index 12a48f498b75847926ab7bc96ecd78fdd248971a..bd212b269094df361721034caed32db96d27b620 100644 (file)
@@ -720,7 +720,7 @@ static int cygnus_gpio_probe(struct platform_device *pdev)
        gc->ngpio = ngpios;
        chip->num_banks = (ngpios + NGPIOS_PER_BANK - 1) / NGPIOS_PER_BANK;
        gc->label = dev_name(dev);
-       gc->dev = dev;
+       gc->parent = dev;
        gc->of_node = dev->of_node;
        gc->request = cygnus_gpio_request;
        gc->free = cygnus_gpio_free;
index b59ce75b1947a2327804ca075769cddc9eba2801..bb92f8ae6b33197c34749ba38d5b74f64dfa03f8 100644 (file)
@@ -598,7 +598,7 @@ static int byt_gpio_probe(struct platform_device *pdev)
        gc->dbg_show = byt_gpio_dbg_show;
        gc->base = -1;
        gc->can_sleep = false;
-       gc->dev = dev;
+       gc->parent = dev;
 
 #ifdef CONFIG_PM_SLEEP
        vg->saved_context = devm_kcalloc(&pdev->dev, gc->ngpio,
index 84936bae6e5ee07f741477cd185509f86bb816a7..dac8ec46aeb48e7aad31dd45d19e89fa91d0305f 100644 (file)
@@ -1436,7 +1436,7 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
 
        chip->ngpio = pctrl->community->ngpios;
        chip->label = dev_name(pctrl->dev);
-       chip->dev = pctrl->dev;
+       chip->parent = pctrl->dev;
        chip->base = -1;
 
        ret = gpiochip_add(chip);
index 392e28d3f48d0bee1a4087154e904c7dfdc0faa7..401c186244be6babac08a3ef9a2f74526e613814 100644 (file)
@@ -874,7 +874,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
 
        pctrl->chip.ngpio = pctrl->soc->npins;
        pctrl->chip.label = dev_name(pctrl->dev);
-       pctrl->chip.dev = pctrl->dev;
+       pctrl->chip.parent = pctrl->dev;
        pctrl->chip.base = -1;
 
        ret = gpiochip_add(&pctrl->chip);
index f307f1d27d646fcd3954a9d497528fffbf16dc2b..a71f68362967f2050571acf0c1d3430ed358e782 100644 (file)
@@ -95,7 +95,7 @@ static void mtk_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
 {
        unsigned int reg_addr;
        unsigned int bit;
-       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
 
        reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dout_offset;
        bit = BIT(offset & 0xf);
@@ -742,7 +742,7 @@ static int mtk_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
        unsigned int bit;
        unsigned int read_val = 0;
 
-       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
 
        reg_addr =  mtk_get_port(pctl, offset) + pctl->devdata->dir_offset;
        bit = BIT(offset & 0xf);
@@ -755,7 +755,7 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
        unsigned int reg_addr;
        unsigned int bit;
        unsigned int read_val = 0;
-       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
 
        if (mtk_gpio_get_direction(chip, offset))
                reg_addr = mtk_get_port(pctl, offset) +
@@ -772,7 +772,7 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
 static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
        const struct mtk_desc_pin *pin;
-       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
        int irq;
 
        pin = pctl->devdata->pins + offset;
@@ -940,7 +940,7 @@ static void mtk_eint_unmask(struct irq_data *d)
 static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
        unsigned debounce)
 {
-       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
        int eint_num, virq, eint_offset;
        unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
        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,
        *pctl->chip = mtk_gpio_chip;
        pctl->chip->ngpio = pctl->devdata->npins;
        pctl->chip->label = dev_name(&pdev->dev);
-       pctl->chip->dev = &pdev->dev;
+       pctl->chip->parent = &pdev->dev;
        pctl->chip->base = -1;
 
        ret = gpiochip_add(pctl->chip);
index 84943e4cff0990c62e0e551349a3d2aa73f9cf43..4b5f6829144d401143e481c30076f1a7b2a880f2 100644 (file)
@@ -562,7 +562,7 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
                domain = &pc->domains[i];
 
                domain->chip.label = domain->data->name;
-               domain->chip.dev = pc->dev;
+               domain->chip.parent = pc->dev;
                domain->chip.request = meson_gpio_request;
                domain->chip.free = meson_gpio_free;
                domain->chip.direction_input = meson_gpio_direction_input;
index b59fbb4b1fb1e5ba4325eeae1a18ffb91e7f841e..434d5de0177be1d04413709ec63cfff1ad1ad552 100644 (file)
@@ -986,7 +986,7 @@ static int abx500_pin_config_set(struct pinctrl_dev *pctldev,
                param = pinconf_to_config_param(configs[i]);
                argument = pinconf_to_config_argument(configs[i]);
 
-               dev_dbg(chip->dev, "pin %d [%#lx]: %s %s\n",
+               dev_dbg(chip->parent, "pin %d [%#lx]: %s %s\n",
                        pin, configs[i],
                        (param == PIN_CONFIG_OUTPUT) ? "output " : "input",
                        (param == PIN_CONFIG_OUTPUT) ?
@@ -1077,7 +1077,8 @@ static int abx500_pin_config_set(struct pinctrl_dev *pctldev,
                        break;
 
                default:
-                       dev_err(chip->dev, "illegal configuration requested\n");
+                       dev_err(chip->parent,
+                               "illegal configuration requested\n");
                }
        } /* for each config */
 out:
@@ -1172,7 +1173,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
        pct->dev = &pdev->dev;
        pct->parent = dev_get_drvdata(pdev->dev.parent);
        pct->chip = abx500gpio_chip;
-       pct->chip.dev = &pdev->dev;
+       pct->chip.parent = &pdev->dev;
        pct->chip.base = -1; /* Dynamic allocation */
 
        match = of_match_device(abx500_gpio_match, &pdev->dev);
index eebfae0c9b7c84a6eacc4ad450d0765e602a011f..cb4a327425a04f1fdd74e245be47b4910a90bcf7 100644 (file)
@@ -438,7 +438,7 @@ nmk_gpio_disable_lazy_irq(struct nmk_gpio_chip *nmk_chip, unsigned offset)
                               nmk_chip->addr + NMK_GPIO_FIMSC);
        }
 
-       dev_dbg(nmk_chip->chip.dev, "%d: clearing interrupt mask\n", gpio);
+       dev_dbg(nmk_chip->chip.parent, "%d: clearing interrupt mask\n", gpio);
 }
 
 static 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,
        chip->base = id * NMK_GPIO_PER_CHIP;
        chip->ngpio = NMK_GPIO_PER_CHIP;
        chip->label = dev_name(&gpio_pdev->dev);
-       chip->dev = &gpio_pdev->dev;
+       chip->parent = &gpio_pdev->dev;
 
        res = platform_get_resource(gpio_pdev, IORESOURCE_MEM, 0);
        base = devm_ioremap_resource(&pdev->dev, res);
@@ -1890,7 +1890,7 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
                        if (slpm_val)
                                val = slpm_val - 1;
 
-                       dev_dbg(nmk_chip->chip.dev,
+                       dev_dbg(nmk_chip->chip.parent,
                                "pin %d: sleep pull %s, dir %s, val %s\n",
                                pin,
                                slpm_pull ? pullnames[pull] : "same",
@@ -1899,7 +1899,7 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned pin,
                                slpm_val ? (val ? "high" : "low") : "same");
                }
 
-               dev_dbg(nmk_chip->chip.dev,
+               dev_dbg(nmk_chip->chip.parent,
                        "pin %d [%#lx]: pull %s, slpm %s (%s%s), lowemi %s\n",
                        pin, cfg, pullnames[pull], slpmnames[slpm],
                        output ? "output " : "input",
index 3318f1d6193c8a49f1ca8f4348dd25010fe18758..a74b2b0a75e0c20f85ea02ca014803b43524b292 100644 (file)
@@ -778,7 +778,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
        gpio_dev->gc.base                       = 0;
        gpio_dev->gc.label                      = pdev->name;
        gpio_dev->gc.owner                      = THIS_MODULE;
-       gpio_dev->gc.dev                        = &pdev->dev;
+       gpio_dev->gc.parent                     = &pdev->dev;
        gpio_dev->gc.ngpio                      = TOTAL_NUMBER_OF_PINS;
 #if defined(CONFIG_OF_GPIO)
        gpio_dev->gc.of_node                    = pdev->dev.of_node;
index 56af28b95a44f627d145c6f91a52765787f2ae52..89479bea6262214650423dab4e2b7b262161f8fb 100644 (file)
@@ -582,7 +582,7 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
        }
 
        as_pci->gpio_chip = as3722_gpio_chip;
-       as_pci->gpio_chip.dev = &pdev->dev;
+       as_pci->gpio_chip.parent = &pdev->dev;
        as_pci->gpio_chip.of_node = pdev->dev.parent->of_node;
        ret = gpiochip_add(&as_pci->gpio_chip);
        if (ret < 0) {
index 33edd07d9149b6b2c895d4c9708dc0f95aa41700..f1daf8580167291b257fa22403c29309c1f5a249 100644 (file)
@@ -290,7 +290,7 @@ static void atmel_gpio_irq_handler(struct irq_desc *desc)
 
 static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 {
-       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev);
+       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
        struct atmel_pin *pin = atmel_pioctrl->pins[offset];
        unsigned reg;
 
@@ -305,7 +305,7 @@ static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
 
 static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
-       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev);
+       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
        struct atmel_pin *pin = atmel_pioctrl->pins[offset];
        unsigned reg;
 
@@ -317,7 +317,7 @@ static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset)
 static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
                                       int value)
 {
-       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev);
+       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
        struct atmel_pin *pin = atmel_pioctrl->pins[offset];
        unsigned reg;
 
@@ -336,7 +336,7 @@ static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
 
 static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
 {
-       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev);
+       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
        struct atmel_pin *pin = atmel_pioctrl->pins[offset];
 
        atmel_gpio_write(atmel_pioctrl, pin->bank,
@@ -346,7 +346,7 @@ static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
 
 static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
-       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->dev);
+       struct atmel_pioctrl *atmel_pioctrl = dev_get_drvdata(chip->parent);
 
        return irq_find_mapping(atmel_pioctrl->irq_domain, offset);
 }
@@ -969,7 +969,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
        atmel_pioctrl->gpio_chip->of_node = dev->of_node;
        atmel_pioctrl->gpio_chip->ngpio = atmel_pioctrl->npins;
        atmel_pioctrl->gpio_chip->label = dev_name(dev);
-       atmel_pioctrl->gpio_chip->dev = dev;
+       atmel_pioctrl->gpio_chip->parent = dev;
        atmel_pioctrl->gpio_chip->names = atmel_pioctrl->group_names;
 
        atmel_pioctrl->pm_wakeup_sources = devm_kzalloc(dev,
index 0d2fc0cff35ee6216ef5e62a77376e63cb2675e7..667d90607abc8e148eb05ff6c5613f3321cf07e5 100644 (file)
@@ -1750,7 +1750,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
        chip = &at91_chip->chip;
        chip->of_node = np;
        chip->label = dev_name(&pdev->dev);
-       chip->dev = &pdev->dev;
+       chip->parent = &pdev->dev;
        chip->owner = THIS_MODULE;
        chip->base = alias_idx * MAX_NB_GPIO_PER_BANK;
 
index 813eb7c771ecb5a38e33eedcb5d0a92d4c9edde4..e1cbf56df4b2b6383ed4314e3f0fcacca1cc8231 100644 (file)
@@ -637,7 +637,7 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
 
        gpio->chip = u300_gpio_chip;
        gpio->chip.ngpio = U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT;
-       gpio->chip.dev = &pdev->dev;
+       gpio->chip.parent = &pdev->dev;
        gpio->chip.base = 0;
        gpio->dev = &pdev->dev;
 
index 38a7799f8257e1fe18756d208b7dfb776775f39b..d8efb2ccac6ce56ab03155e448eb4cdfbac0df96 100644 (file)
@@ -244,7 +244,7 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np)
        int ret;
 
        chip->label             = DRIVER_NAME;
-       chip->dev               = pmap->dev;
+       chip->parent            = pmap->dev;
        chip->request           = gpiochip_generic_request;
        chip->free              = gpiochip_generic_free;
        chip->direction_input   = dc_gpio_direction_input;
index 85c9046c690e2c44ab0da44571ac75a252da9708..fd5148d106a392e51df0f1812bd420ad924b8148 100644 (file)
@@ -1388,7 +1388,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
                bank->pctl = pctl;
                bank->base = pctl->base + GPIO_BANK_BASE(i);
 
-               bank->gpio_chip.dev = pctl->dev;
+               bank->gpio_chip.parent = pctl->dev;
                bank->gpio_chip.of_node = child;
                ret = gpiochip_add(&bank->gpio_chip);
                if (ret < 0) {
index a0651128e23acc68fbe139dc10da3e859da2b9a1..2b88a40f61d3dbe9ca1416aec7b0690a9566d03b 100644 (file)
@@ -1754,7 +1754,7 @@ static int rockchip_gpiolib_register(struct platform_device *pdev,
                gc = &bank->gpio_chip;
                gc->base = bank->pin_base;
                gc->ngpio = bank->nr_pins;
-               gc->dev = &pdev->dev;
+               gc->parent = &pdev->dev;
                gc->of_node = bank->of_node;
                gc->label = bank->name;
 
index b58d3f29148a402120a2993cc57a2d0eee1df563..52639e65ea67332ea0fe69fb478e44214e61eaf7 100644 (file)
@@ -1522,7 +1522,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
        bank->gpio_chip.base = bank_num * ST_GPIO_PINS_PER_BANK;
        bank->gpio_chip.ngpio = ST_GPIO_PINS_PER_BANK;
        bank->gpio_chip.of_node = np;
-       bank->gpio_chip.dev = dev;
+       bank->gpio_chip.parent = dev;
        spin_lock_init(&bank->lock);
 
        of_property_read_string(np, "st,bank-name", &range->name);
index ae724bdab3d324cbf9018e8f2bdaf6fc44103f02..b4380fb7200138dad3e3df7914a5addf97ced8e4 100644 (file)
@@ -648,7 +648,7 @@ static struct ltq_pinmux_info xway_info = {
 /* ---------  gpio_chip related code --------- */
 static void xway_gpio_set(struct gpio_chip *chip, unsigned int pin, int val)
 {
-       struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
+       struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
 
        if (val)
                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)
 
 static int xway_gpio_get(struct gpio_chip *chip, unsigned int pin)
 {
-       struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
+       struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
 
        return gpio_getbit(info->membase[0], GPIO_IN(pin), PORT_PIN(pin));
 }
 
 static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin)
 {
-       struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
+       struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
 
        gpio_clearbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
 
@@ -674,7 +674,7 @@ static int xway_gpio_dir_in(struct gpio_chip *chip, unsigned int pin)
 
 static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val)
 {
-       struct ltq_pinmux_info *info = dev_get_drvdata(chip->dev);
+       struct ltq_pinmux_info *info = dev_get_drvdata(chip->parent);
 
        gpio_setbit(info->membase[0], GPIO_DIR(pin), PORT_PIN(pin));
        xway_gpio_set(chip, pin, val);
@@ -783,7 +783,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
        xway_pctrl_desc.pins = xway_info.pads;
 
        /* load the gpio chip */
-       xway_chip.dev = &pdev->dev;
+       xway_chip.parent = &pdev->dev;
        ret = gpiochip_add(&xway_chip);
        if (ret) {
                dev_err(&pdev->dev, "Failed to register gpio chip\n");
index 146264a41ec8844876e81ecd77eda16588c80950..af2a13040898fde2924505d6e69c20a45cc67d49 100644 (file)
@@ -800,7 +800,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
        chip->base = 0;
        chip->ngpio = ngpio;
        chip->label = dev_name(pctrl->dev);
-       chip->dev = pctrl->dev;
+       chip->parent = pctrl->dev;
        chip->owner = THIS_MODULE;
        chip->of_node = pctrl->dev->of_node;
 
index 6c42ca14d2fd315d9e43faca2a48315815d53bd8..3e5ccc76d59ca7bd4ccacc472b96c27255409669 100644 (file)
@@ -760,7 +760,7 @@ static int pmic_gpio_probe(struct platform_device *pdev)
        }
 
        state->chip = pmic_gpio_gpio_template;
-       state->chip.dev = dev;
+       state->chip.parent = dev;
        state->chip.base = -1;
        state->chip.ngpio = npins;
        state->chip.label = dev_name(dev);
index 9ce0e30e33e81b024ecee8169d86b165ce1d69d7..69c14ba177d0b51779dd7043efe18b9132b38bd7 100644 (file)
@@ -862,7 +862,7 @@ static int pmic_mpp_probe(struct platform_device *pdev)
        }
 
        state->chip = pmic_mpp_gpio_template;
-       state->chip.dev = dev;
+       state->chip.parent = dev;
        state->chip.base = -1;
        state->chip.ngpio = npins;
        state->chip.label = dev_name(dev);
index d809c9eaa3231817512bdda858ad208d0f1138e4..7b80fa9c20493f528a728e66cbcb4af582e44e81 100644 (file)
@@ -730,7 +730,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
 
        pctrl->chip = pm8xxx_gpio_template;
        pctrl->chip.base = -1;
-       pctrl->chip.dev = &pdev->dev;
+       pctrl->chip.parent = &pdev->dev;
        pctrl->chip.of_node = pdev->dev.of_node;
        pctrl->chip.of_gpio_n_cells = 2;
        pctrl->chip.label = dev_name(pctrl->dev);
index 8982027de8e8b528f026f38d58ccdf692901635c..7bc1e0f2744766a64e4e5f245448fe9e3849eac2 100644 (file)
@@ -821,7 +821,7 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
 
        pctrl->chip = pm8xxx_mpp_template;
        pctrl->chip.base = -1;
-       pctrl->chip.dev = &pdev->dev;
+       pctrl->chip.parent = &pdev->dev;
        pctrl->chip.of_node = pdev->dev.of_node;
        pctrl->chip.of_gpio_n_cells = 2;
        pctrl->chip.label = dev_name(pctrl->dev);
index 71ccf6a90b222d14a02f771862d8c227cc115b80..7d7374e57f16054dcc1ae7e68029626e9bfa1b57 100644 (file)
@@ -176,7 +176,8 @@ static int exynos_irq_request_resources(struct irq_data *irqd)
 
        ret = gpiochip_lock_as_irq(&bank->gpio_chip, irqd->hwirq);
        if (ret) {
-               dev_err(bank->gpio_chip.dev, "unable to lock pin %s-%lu IRQ\n",
+               dev_err(bank->gpio_chip.parent,
+                       "unable to lock pin %s-%lu IRQ\n",
                        bank->name, irqd->hwirq);
                return ret;
        }
index 82dc109f7ed46629405d7663f2b853c50ed647e5..f61f9a6fa9af841a477076469d258d0b452774a7 100644 (file)
@@ -539,7 +539,7 @@ static const struct pinconf_ops exynos5440_pinconf_ops = {
 /* gpiolib gpio_set callback function */
 static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
 {
-       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
+       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
        void __iomem *base = priv->reg_base;
        u32 data;
 
@@ -553,7 +553,7 @@ static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value
 /* gpiolib gpio_get callback function */
 static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset)
 {
-       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
+       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
        void __iomem *base = priv->reg_base;
        u32 data;
 
@@ -566,7 +566,7 @@ static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset)
 /* gpiolib gpio_direction_input callback function */
 static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
 {
-       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
+       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
        void __iomem *base = priv->reg_base;
        u32 data;
 
@@ -586,7 +586,7 @@ static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset
 static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
                                                        int value)
 {
-       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
+       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
        void __iomem *base = priv->reg_base;
        u32 data;
 
@@ -607,7 +607,7 @@ static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offse
 /* gpiolib gpio_to_irq callback function */
 static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
 {
-       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
+       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->parent);
        unsigned int virq;
 
        if (offset < 16 || offset > 23)
@@ -817,7 +817,7 @@ static int exynos5440_gpiolib_register(struct platform_device *pdev,
        priv->gc = gc;
        gc->base = 0;
        gc->ngpio = EXYNOS5440_MAX_PINS;
-       gc->dev = &pdev->dev;
+       gc->parent = &pdev->dev;
        gc->set = exynos5440_gpio_set;
        gc->get = exynos5440_gpio_get;
        gc->direction_input = exynos5440_gpio_direction_input;
index 3f622ccd8eabd74a3f0df889298254dbcdee1510..bb4db2050f19ced10a6eea10d5a692de4495e957 100644 (file)
@@ -914,7 +914,7 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
                gc = &bank->gpio_chip;
                gc->base = drvdata->pin_base + bank->pin_base;
                gc->ngpio = bank->nr_pins;
-               gc->dev = &pdev->dev;
+               gc->parent = &pdev->dev;
                gc->of_node = bank->of_node;
                gc->label = bank->name;
 
index db3f09aa8993cdda59a2cec8369d2d13047a230e..cdb2460a7b004543a7f2ce108b7b9a297f416ca5 100644 (file)
@@ -246,7 +246,7 @@ static int gpio_pin_setup(struct sh_pfc_chip *chip)
        gc->to_irq = gpio_pin_to_irq;
 
        gc->label = pfc->info->name;
-       gc->dev = pfc->dev;
+       gc->parent = pfc->dev;
        gc->owner = THIS_MODULE;
        gc->base = 0;
        gc->ngpio = pfc->nr_gpio_pins;
index 829018c812bdda3690f7449626cecccb2de8874b..1850dc1b386361f706c29f991c697c2303b40730 100644 (file)
@@ -6012,7 +6012,7 @@ static int atlas7_gpio_probe(struct platform_device *pdev)
        chip->label = kstrdup(np->name, GFP_KERNEL);
        chip->of_node = np;
        chip->of_gpio_n_cells = 2;
-       chip->dev = &pdev->dev;
+       chip->parent = &pdev->dev;
 
        /* Add gpio chip to system */
        ret = gpiochip_add(chip);
index 2a8d69725de81aab6a469faa02558d065f22f7d9..ae97bdc75a69b963750187e37db8efa943c8a4d5 100644 (file)
@@ -811,7 +811,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
        sgpio->chip.gc.of_node = np;
        sgpio->chip.gc.of_xlate = sirfsoc_gpio_of_xlate;
        sgpio->chip.gc.of_gpio_n_cells = 2;
-       sgpio->chip.gc.dev = &pdev->dev;
+       sgpio->chip.gc.parent = &pdev->dev;
        sgpio->chip.regs = regs;
 
        err = gpiochip_add(&sgpio->chip.gc);
index 1f0af250dbb51362d30fb385fc09011dc16c7275..925f597de266dae4ca48a9a3076dea0b78dc4f83 100644 (file)
@@ -561,7 +561,7 @@ static int plgpio_probe(struct platform_device *pdev)
        plgpio->chip.get = plgpio_get_value;
        plgpio->chip.set = plgpio_set_value;
        plgpio->chip.label = dev_name(&pdev->dev);
-       plgpio->chip.dev = &pdev->dev;
+       plgpio->chip.parent = &pdev->dev;
        plgpio->chip.owner = THIS_MODULE;
        plgpio->chip.of_node = pdev->dev.of_node;
 
index dead97daca35fe2e59a0e81f7898b4e66f27b0cb..a437e4f8628bf75831dbcb7c83727cb67af9e60e 100644 (file)
@@ -454,7 +454,7 @@ static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip,
 
 static int sunxi_pinctrl_gpio_get(struct gpio_chip *chip, unsigned offset)
 {
-       struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent);
        u32 reg = sunxi_data_reg(offset);
        u8 index = sunxi_data_offset(offset);
        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)
 static void sunxi_pinctrl_gpio_set(struct gpio_chip *chip,
                                unsigned offset, int value)
 {
-       struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent);
        u32 reg = sunxi_data_reg(offset);
        u8 index = sunxi_data_offset(offset);
        unsigned long flags;
@@ -522,7 +522,7 @@ static int sunxi_pinctrl_gpio_of_xlate(struct gpio_chip *gc,
 
 static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 {
-       struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->dev);
+       struct sunxi_pinctrl *pctl = dev_get_drvdata(chip->parent);
        struct sunxi_desc_function *desc;
        unsigned pinnum = pctl->desc->pin_base + offset;
        unsigned irqnum;
@@ -536,7 +536,7 @@ static int sunxi_pinctrl_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
 
        irqnum = desc->irqbank * IRQ_PER_BANK + desc->irqnum;
 
-       dev_dbg(chip->dev, "%s: request IRQ for GPIO %d, return %d\n",
+       dev_dbg(chip->parent, "%s: request IRQ for GPIO %d, return %d\n",
                chip->label, offset + chip->base, irqnum);
 
        return irq_find_mapping(pctl->domain, irqnum);
@@ -959,7 +959,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
        pctl->chip->ngpio = round_up(last_pin, PINS_PER_BANK) -
                            pctl->desc->pin_base;
        pctl->chip->label = dev_name(&pdev->dev);
-       pctl->chip->dev = &pdev->dev;
+       pctl->chip->parent = &pdev->dev;
        pctl->chip->base = pctl->desc->pin_base;
 
        ret = gpiochip_add(pctl->chip);
index fb22d3f62480d9f88f04cb4f93e7f0de45e5bf66..e9c1dfd9057002c8230dadeafeb2d272898c1ecb 100644 (file)
@@ -488,7 +488,7 @@ static struct pinctrl_desc wmt_desc = {
 
 static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
 {
-       struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev);
+       struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent);
        u32 bank = WMT_BANK_FROM_PIN(offset);
        u32 bit = WMT_BIT_FROM_PIN(offset);
        u32 reg_dir = data->banks[bank].reg_dir;
@@ -503,7 +503,7 @@ static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
 
 static int wmt_gpio_get_value(struct gpio_chip *chip, unsigned offset)
 {
-       struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev);
+       struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent);
        u32 bank = WMT_BANK_FROM_PIN(offset);
        u32 bit = WMT_BIT_FROM_PIN(offset);
        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)
 static void wmt_gpio_set_value(struct gpio_chip *chip, unsigned offset,
                               int val)
 {
-       struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev);
+       struct wmt_pinctrl_data *data = dev_get_drvdata(chip->parent);
        u32 bank = WMT_BANK_FROM_PIN(offset);
        u32 bit = WMT_BIT_FROM_PIN(offset);
        u32 reg_data_out = data->banks[bank].reg_data_out;
@@ -575,7 +575,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
        wmt_desc.npins = data->npins;
 
        data->gpio_chip = wmt_gpio_chip;
-       data->gpio_chip.dev = &pdev->dev;
+       data->gpio_chip.parent = &pdev->dev;
        data->gpio_chip.of_node = pdev->dev.of_node;
        data->gpio_chip.ngpio = data->nbanks * 32;
 
index 709f0afdafa866da408afc364604697be7a29bc7..0e73fd10ba72a1d8eeafa25a0cf15970c37a2340 100644 (file)
@@ -274,11 +274,11 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev)
        pg->chip.base = pdata->gpio_base;
        pg->chip.ngpio = NUM_GPIO;
        pg->chip.can_sleep = 1;
-       pg->chip.dev = dev;
+       pg->chip.parent = dev;
 
        mutex_init(&pg->buslock);
 
-       pg->chip.dev = dev;
+       pg->chip.parent = dev;
        retval = gpiochip_add(&pg->chip);
        if (retval) {
                pr_err("Can not add pmic gpio chip\n");
index d45133056f51d5d114d3aab23849d4b3a1b240cf..3f98165b479c5ee41cca31113497c307ad03ac92 100644 (file)
@@ -1174,7 +1174,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
 #ifdef CONFIG_GPIOLIB
        /* Setup GPIO cotroller */
        s->gpio.owner           = THIS_MODULE;
-       s->gpio.dev             = dev;
+       s->gpio.parent          = dev;
        s->gpio.label           = dev_name(dev);
        s->gpio.direction_input = max310x_gpio_direction_input;
        s->gpio.get             = max310x_gpio_get;
index edb5305b9d4da72e388452f66db9e65e40d15f18..cc86c348d8097875648784e1de99a078d6fb8671 100644 (file)
@@ -1180,7 +1180,7 @@ static int sc16is7xx_probe(struct device *dev,
        if (devtype->nr_gpio) {
                /* Setup GPIO cotroller */
                s->gpio.owner            = THIS_MODULE;
-               s->gpio.dev              = dev;
+               s->gpio.parent           = dev;
                s->gpio.label            = dev_name(dev);
                s->gpio.direction_input  = sc16is7xx_gpio_direction_input;
                s->gpio.get              = sc16is7xx_gpio_get;
index d1baebf350d8109a30a6bbe3ff15dc25f3146e14..b02c43be7859fc000b6a0c7bacf9459f4adbfdd9 100644 (file)
@@ -20,7 +20,7 @@ struct seq_file;
 /**
  * struct gpio_chip - abstract a GPIO controller
  * @label: for diagnostics
- * @dev: optional device providing the GPIOs
+ * @parent: optional parent device providing the GPIOs
  * @cdev: class device used by sysfs interface (may be NULL)
  * @owner: helps prevent removal of modules exporting active GPIOs
  * @list: links gpio_chips together for traversal
@@ -89,7 +89,7 @@ struct seq_file;
  */
 struct gpio_chip {
        const char              *label;
-       struct device           *dev;
+       struct device           *parent;
        struct device           *cdev;
        struct module           *owner;
        struct list_head        list;
index b4cd7e3bf5f89f9ea940528f233f017151788a4b..1f590b5a67186047083a207efb6a8bf26a360175 100644 (file)
@@ -4674,7 +4674,7 @@ static void rt5677_init_gpio(struct i2c_client *i2c)
 
        rt5677->gpio_chip = rt5677_template_chip;
        rt5677->gpio_chip.ngpio = RT5677_GPIO_NUM;
-       rt5677->gpio_chip.dev = &i2c->dev;
+       rt5677->gpio_chip.parent = &i2c->dev;
        rt5677->gpio_chip.base = -1;
 
        ret = gpiochip_add(&rt5677->gpio_chip);
index c2cdcae18ff620e611a5fdda23f0355ca13bd58d..171a23ddd15d924e2533316a1922315c6dfdea7c 100644 (file)
@@ -2306,7 +2306,7 @@ static void wm5100_init_gpio(struct i2c_client *i2c)
 
        wm5100->gpio_chip = wm5100_template_chip;
        wm5100->gpio_chip.ngpio = 6;
-       wm5100->gpio_chip.dev = &i2c->dev;
+       wm5100->gpio_chip.parent = &i2c->dev;
 
        if (wm5100->pdata.gpio_base)
                wm5100->gpio_chip.base = wm5100->pdata.gpio_base;
index e4cc41e6c23e333cbb771d6f1da91c19c5ff6079..2512def0d3494a6907066debc7113fa4e001335b 100644 (file)
@@ -1853,7 +1853,7 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903)
 
        wm8903->gpio_chip = wm8903_template_chip;
        wm8903->gpio_chip.ngpio = WM8903_NUM_GPIO;
-       wm8903->gpio_chip.dev = wm8903->dev;
+       wm8903->gpio_chip.parent = wm8903->dev;
 
        if (pdata->gpio_base)
                wm8903->gpio_chip.base = pdata->gpio_base;
index 39ebd7bf4f5306382c86fb49f3417dc3c908dcad..b563d6746ac43992069fb7ad07498293818bef3b 100644 (file)
@@ -3380,7 +3380,7 @@ static void wm8962_init_gpio(struct snd_soc_codec *codec)
 
        wm8962->gpio_chip = wm8962_template_chip;
        wm8962->gpio_chip.ngpio = WM8962_MAX_GPIO;
-       wm8962->gpio_chip.dev = codec->dev;
+       wm8962->gpio_chip.parent = codec->dev;
 
        if (pdata->gpio_base)
                wm8962->gpio_chip.base = pdata->gpio_base;
index f7ccd9fc5808e56950225d2ccccd7a8ad8d2de62..8d7d6c01a2f7264905e7a8e29888a417f44fb515 100644 (file)
@@ -2204,7 +2204,7 @@ static void wm8996_init_gpio(struct wm8996_priv *wm8996)
 
        wm8996->gpio_chip = wm8996_template_chip;
        wm8996->gpio_chip.ngpio = 5;
-       wm8996->gpio_chip.dev = wm8996->dev;
+       wm8996->gpio_chip.parent = wm8996->dev;
 
        if (wm8996->pdata.gpio_base)
                wm8996->gpio_chip.base = wm8996->pdata.gpio_base;