diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-12-15 23:50:43 +0100 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-01-25 09:24:20 +0900 |
commit | d4e62d0094e1b0f69946c3f16ce8ec882302a461 (patch) | |
tree | fd39f7a3ee241d0c8af31220143caebdafe45c7c /drivers/sh/pfc/gpio.c | |
parent | e62ebcdbce9eff4dc48168e86960c0dfcba086ea (diff) | |
download | op-kernel-dev-d4e62d0094e1b0f69946c3f16ce8ec882302a461.zip op-kernel-dev-d4e62d0094e1b0f69946c3f16ce8ec882302a461.tar.gz |
sh-pfc: Split platform data from the sh_pfc structure
Create a sh_pfc_platform_data structure to store platform data and
reference it from the core sh_pfc structure.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/sh/pfc/gpio.c')
-rw-r--r-- | drivers/sh/pfc/gpio.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/sh/pfc/gpio.c b/drivers/sh/pfc/gpio.c index 6a24f07..7597a02 100644 --- a/drivers/sh/pfc/gpio.c +++ b/drivers/sh/pfc/gpio.c @@ -103,11 +103,11 @@ static int sh_gpio_to_irq(struct gpio_chip *gc, unsigned offset) if (pos <= 0 || !enum_id) break; - for (i = 0; i < pfc->gpio_irq_size; i++) { - enum_ids = pfc->gpio_irq[i].enum_ids; + for (i = 0; i < pfc->pdata->gpio_irq_size; i++) { + enum_ids = pfc->pdata->gpio_irq[i].enum_ids; for (k = 0; enum_ids[k]; k++) { if (enum_ids[k] == enum_id) - return pfc->gpio_irq[i].irq; + return pfc->pdata->gpio_irq[i].irq; } } } @@ -128,12 +128,12 @@ static void sh_pfc_gpio_setup(struct sh_pfc_chip *chip) gc->set = sh_gpio_set; gc->to_irq = sh_gpio_to_irq; - WARN_ON(pfc->first_gpio != 0); /* needs testing */ + WARN_ON(pfc->pdata->first_gpio != 0); /* needs testing */ - gc->label = pfc->name; + gc->label = pfc->pdata->name; gc->owner = THIS_MODULE; - gc->base = pfc->first_gpio; - gc->ngpio = (pfc->last_gpio - pfc->first_gpio) + 1; + gc->base = pfc->pdata->first_gpio; + gc->ngpio = (pfc->pdata->last_gpio - pfc->pdata->first_gpio) + 1; } int sh_pfc_register_gpiochip(struct sh_pfc *pfc) @@ -154,7 +154,8 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc) kfree(chip); pr_info("%s handling gpio %d -> %d\n", - pfc->name, pfc->first_gpio, pfc->last_gpio); + pfc->pdata->name, pfc->pdata->first_gpio, + pfc->pdata->last_gpio); return ret; } @@ -179,7 +180,7 @@ static int sh_pfc_gpio_probe(struct platform_device *pdev) chip = gpio_to_pfc_chip(gc); platform_set_drvdata(pdev, chip); - pr_info("attaching to GPIO chip %s\n", chip->pfc->name); + pr_info("attaching to GPIO chip %s\n", chip->pfc->pdata->name); return 0; } |