aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/mpc8xxx_gpio.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2010-06-08 09:48:16 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-05 18:14:30 -0400
commita19e3da5bc5fc6c10ab73f310bea80f3845b4531 (patch)
tree49b6e952f48e56d9701f92e0c24044a14b676a34 /arch/powerpc/sysdev/mpc8xxx_gpio.c
parentcedb1881ba32f7e9cd49250bd79debccbe52b094 (diff)
of/gpio: Kill of_gpio_chip and add members directly to gpio_chip
The OF gpio infrastructure is great for describing GPIO connections within the device tree. However, using a GPIO binding still requires changes to the gpio controller just to add an of_gpio structure. In most cases, the gpio controller doesn't actually need any special support and the simple OF gpio mapping function is more than sufficient. Additional, the current scheme of using of_gpio_chip requires a convoluted scheme to maintain 1:1 mappings between of_gpio_chip and gpio_chip instances. If the struct of_gpio_chip data members were moved into struct gpio_chip, then it would simplify the processing of OF gpio bindings, and it would make it trivial to use device tree OF connections on existing gpiolib controller drivers. This patch eliminates the of_gpio_chip structure and moves the relevant fields into struct gpio_chip (conditional on CONFIG_OF_GPIO). This move simplifies the existing code and prepares for adding automatic device tree support to existing drivers. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Bill Gatliff <bgat@billgatliff.com> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'arch/powerpc/sysdev/mpc8xxx_gpio.c')
-rw-r--r--arch/powerpc/sysdev/mpc8xxx_gpio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/mpc8xxx_gpio.c b/arch/powerpc/sysdev/mpc8xxx_gpio.c
index 83f519655fac..ec8fcd42101e 100644
--- a/arch/powerpc/sysdev/mpc8xxx_gpio.c
+++ b/arch/powerpc/sysdev/mpc8xxx_gpio.c
@@ -257,7 +257,6 @@ static void __init mpc8xxx_add_controller(struct device_node *np)
257{ 257{
258 struct mpc8xxx_gpio_chip *mpc8xxx_gc; 258 struct mpc8xxx_gpio_chip *mpc8xxx_gc;
259 struct of_mm_gpio_chip *mm_gc; 259 struct of_mm_gpio_chip *mm_gc;
260 struct of_gpio_chip *of_gc;
261 struct gpio_chip *gc; 260 struct gpio_chip *gc;
262 unsigned hwirq; 261 unsigned hwirq;
263 int ret; 262 int ret;
@@ -271,11 +270,10 @@ static void __init mpc8xxx_add_controller(struct device_node *np)
271 spin_lock_init(&mpc8xxx_gc->lock); 270 spin_lock_init(&mpc8xxx_gc->lock);
272 271
273 mm_gc = &mpc8xxx_gc->mm_gc; 272 mm_gc = &mpc8xxx_gc->mm_gc;
274 of_gc = &mm_gc->of_gc; 273 gc = &mm_gc->gc;
275 gc = &of_gc->gc;
276 274
277 mm_gc->save_regs = mpc8xxx_gpio_save_regs; 275 mm_gc->save_regs = mpc8xxx_gpio_save_regs;
278 of_gc->gpio_cells = 2; 276 gc->of_gpio_n_cells = 2;
279 gc->ngpio = MPC8XXX_GPIO_PINS; 277 gc->ngpio = MPC8XXX_GPIO_PINS;
280 gc->direction_input = mpc8xxx_gpio_dir_in; 278 gc->direction_input = mpc8xxx_gpio_dir_in;
281 gc->direction_output = mpc8xxx_gpio_dir_out; 279 gc->direction_output = mpc8xxx_gpio_dir_out;