aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/axonram.c12
-rw-r--r--arch/powerpc/sysdev/bestcomm/bestcomm.c7
-rw-r--r--arch/powerpc/sysdev/bestcomm/sram.c1
-rw-r--r--arch/powerpc/sysdev/cpm1.c10
-rw-r--r--arch/powerpc/sysdev/cpm_common.c5
-rw-r--r--arch/powerpc/sysdev/fsl_gtm.c1
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c4
-rw-r--r--arch/powerpc/sysdev/fsl_pmc.c3
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c4
-rw-r--r--arch/powerpc/sysdev/mpc8xxx_gpio.c5
-rw-r--r--arch/powerpc/sysdev/mv64x60_dev.c7
-rw-r--r--arch/powerpc/sysdev/pmi.c6
-rw-r--r--arch/powerpc/sysdev/ppc4xx_gpio.c5
-rw-r--r--arch/powerpc/sysdev/qe_lib/gpio.c31
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c5
-rw-r--r--arch/powerpc/sysdev/simple_gpio.c5
16 files changed, 44 insertions, 67 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 402d2212162f..2659a60bd7b8 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -60,7 +60,7 @@
60static int azfs_major, azfs_minor; 60static int azfs_major, azfs_minor;
61 61
62struct axon_ram_bank { 62struct axon_ram_bank {
63 struct of_device *device; 63 struct platform_device *device;
64 struct gendisk *disk; 64 struct gendisk *disk;
65 unsigned int irq_id; 65 unsigned int irq_id;
66 unsigned long ph_addr; 66 unsigned long ph_addr;
@@ -72,7 +72,7 @@ struct axon_ram_bank {
72static ssize_t 72static ssize_t
73axon_ram_sysfs_ecc(struct device *dev, struct device_attribute *attr, char *buf) 73axon_ram_sysfs_ecc(struct device *dev, struct device_attribute *attr, char *buf)
74{ 74{
75 struct of_device *device = to_of_device(dev); 75 struct platform_device *device = to_platform_device(dev);
76 struct axon_ram_bank *bank = device->dev.platform_data; 76 struct axon_ram_bank *bank = device->dev.platform_data;
77 77
78 BUG_ON(!bank); 78 BUG_ON(!bank);
@@ -90,7 +90,7 @@ static DEVICE_ATTR(ecc, S_IRUGO, axon_ram_sysfs_ecc, NULL);
90static irqreturn_t 90static irqreturn_t
91axon_ram_irq_handler(int irq, void *dev) 91axon_ram_irq_handler(int irq, void *dev)
92{ 92{
93 struct of_device *device = dev; 93 struct platform_device *device = dev;
94 struct axon_ram_bank *bank = device->dev.platform_data; 94 struct axon_ram_bank *bank = device->dev.platform_data;
95 95
96 BUG_ON(!bank); 96 BUG_ON(!bank);
@@ -174,8 +174,8 @@ static const struct block_device_operations axon_ram_devops = {
174 * axon_ram_probe - probe() method for platform driver 174 * axon_ram_probe - probe() method for platform driver
175 * @device, @device_id: see of_platform_driver method 175 * @device, @device_id: see of_platform_driver method
176 */ 176 */
177static int 177static int axon_ram_probe(struct platform_device *device,
178axon_ram_probe(struct of_device *device, const struct of_device_id *device_id) 178 const struct of_device_id *device_id)
179{ 179{
180 static int axon_ram_bank_id = -1; 180 static int axon_ram_bank_id = -1;
181 struct axon_ram_bank *bank; 181 struct axon_ram_bank *bank;
@@ -304,7 +304,7 @@ failed:
304 * @device: see of_platform_driver method 304 * @device: see of_platform_driver method
305 */ 305 */
306static int 306static int
307axon_ram_remove(struct of_device *device) 307axon_ram_remove(struct platform_device *device)
308{ 308{
309 struct axon_ram_bank *bank = device->dev.platform_data; 309 struct axon_ram_bank *bank = device->dev.platform_data;
310 310
diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c
index a7c5c470af14..650256115064 100644
--- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
+++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
@@ -365,8 +365,8 @@ bcom_engine_cleanup(void)
365/* OF platform driver */ 365/* OF platform driver */
366/* ======================================================================== */ 366/* ======================================================================== */
367 367
368static int __devinit 368static int __devinit mpc52xx_bcom_probe(struct platform_device *op,
369mpc52xx_bcom_probe(struct of_device *op, const struct of_device_id *match) 369 const struct of_device_id *match)
370{ 370{
371 struct device_node *ofn_sram; 371 struct device_node *ofn_sram;
372 struct resource res_bcom; 372 struct resource res_bcom;
@@ -461,8 +461,7 @@ error_ofput:
461} 461}
462 462
463 463
464static int 464static int mpc52xx_bcom_remove(struct platform_device *op)
465mpc52xx_bcom_remove(struct of_device *op)
466{ 465{
467 /* Clean up the engine */ 466 /* Clean up the engine */
468 bcom_engine_cleanup(); 467 bcom_engine_cleanup();
diff --git a/arch/powerpc/sysdev/bestcomm/sram.c b/arch/powerpc/sysdev/bestcomm/sram.c
index 5d74ef7a651f..1225012a681a 100644
--- a/arch/powerpc/sysdev/bestcomm/sram.c
+++ b/arch/powerpc/sysdev/bestcomm/sram.c
@@ -11,6 +11,7 @@
11 * kind, whether express or implied. 11 * kind, whether express or implied.
12 */ 12 */
13 13
14#include <linux/err.h>
14#include <linux/kernel.h> 15#include <linux/kernel.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
index 8d103ca6d6ab..00852124ff4a 100644
--- a/arch/powerpc/sysdev/cpm1.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -621,7 +621,6 @@ int cpm1_gpiochip_add16(struct device_node *np)
621{ 621{
622 struct cpm1_gpio16_chip *cpm1_gc; 622 struct cpm1_gpio16_chip *cpm1_gc;
623 struct of_mm_gpio_chip *mm_gc; 623 struct of_mm_gpio_chip *mm_gc;
624 struct of_gpio_chip *of_gc;
625 struct gpio_chip *gc; 624 struct gpio_chip *gc;
626 625
627 cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL); 626 cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL);
@@ -631,11 +630,9 @@ int cpm1_gpiochip_add16(struct device_node *np)
631 spin_lock_init(&cpm1_gc->lock); 630 spin_lock_init(&cpm1_gc->lock);
632 631
633 mm_gc = &cpm1_gc->mm_gc; 632 mm_gc = &cpm1_gc->mm_gc;
634 of_gc = &mm_gc->of_gc; 633 gc = &mm_gc->gc;
635 gc = &of_gc->gc;
636 634
637 mm_gc->save_regs = cpm1_gpio16_save_regs; 635 mm_gc->save_regs = cpm1_gpio16_save_regs;
638 of_gc->gpio_cells = 2;
639 gc->ngpio = 16; 636 gc->ngpio = 16;
640 gc->direction_input = cpm1_gpio16_dir_in; 637 gc->direction_input = cpm1_gpio16_dir_in;
641 gc->direction_output = cpm1_gpio16_dir_out; 638 gc->direction_output = cpm1_gpio16_dir_out;
@@ -745,7 +742,6 @@ int cpm1_gpiochip_add32(struct device_node *np)
745{ 742{
746 struct cpm1_gpio32_chip *cpm1_gc; 743 struct cpm1_gpio32_chip *cpm1_gc;
747 struct of_mm_gpio_chip *mm_gc; 744 struct of_mm_gpio_chip *mm_gc;
748 struct of_gpio_chip *of_gc;
749 struct gpio_chip *gc; 745 struct gpio_chip *gc;
750 746
751 cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL); 747 cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL);
@@ -755,11 +751,9 @@ int cpm1_gpiochip_add32(struct device_node *np)
755 spin_lock_init(&cpm1_gc->lock); 751 spin_lock_init(&cpm1_gc->lock);
756 752
757 mm_gc = &cpm1_gc->mm_gc; 753 mm_gc = &cpm1_gc->mm_gc;
758 of_gc = &mm_gc->of_gc; 754 gc = &mm_gc->gc;
759 gc = &of_gc->gc;
760 755
761 mm_gc->save_regs = cpm1_gpio32_save_regs; 756 mm_gc->save_regs = cpm1_gpio32_save_regs;
762 of_gc->gpio_cells = 2;
763 gc->ngpio = 32; 757 gc->ngpio = 32;
764 gc->direction_input = cpm1_gpio32_dir_in; 758 gc->direction_input = cpm1_gpio32_dir_in;
765 gc->direction_output = cpm1_gpio32_dir_out; 759 gc->direction_output = cpm1_gpio32_dir_out;
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 88b9812c854f..2b69aa0315b3 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -325,7 +325,6 @@ int cpm2_gpiochip_add32(struct device_node *np)
325{ 325{
326 struct cpm2_gpio32_chip *cpm2_gc; 326 struct cpm2_gpio32_chip *cpm2_gc;
327 struct of_mm_gpio_chip *mm_gc; 327 struct of_mm_gpio_chip *mm_gc;
328 struct of_gpio_chip *of_gc;
329 struct gpio_chip *gc; 328 struct gpio_chip *gc;
330 329
331 cpm2_gc = kzalloc(sizeof(*cpm2_gc), GFP_KERNEL); 330 cpm2_gc = kzalloc(sizeof(*cpm2_gc), GFP_KERNEL);
@@ -335,11 +334,9 @@ int cpm2_gpiochip_add32(struct device_node *np)
335 spin_lock_init(&cpm2_gc->lock); 334 spin_lock_init(&cpm2_gc->lock);
336 335
337 mm_gc = &cpm2_gc->mm_gc; 336 mm_gc = &cpm2_gc->mm_gc;
338 of_gc = &mm_gc->of_gc; 337 gc = &mm_gc->gc;
339 gc = &of_gc->gc;
340 338
341 mm_gc->save_regs = cpm2_gpio32_save_regs; 339 mm_gc->save_regs = cpm2_gpio32_save_regs;
342 of_gc->gpio_cells = 2;
343 gc->ngpio = 32; 340 gc->ngpio = 32;
344 gc->direction_input = cpm2_gpio32_dir_in; 341 gc->direction_input = cpm2_gpio32_dir_in;
345 gc->direction_output = cpm2_gpio32_dir_out; 342 gc->direction_output = cpm2_gpio32_dir_out;
diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c
index eca4545dd52e..7dd2885321ad 100644
--- a/arch/powerpc/sysdev/fsl_gtm.c
+++ b/arch/powerpc/sysdev/fsl_gtm.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/err.h>
17#include <linux/errno.h> 18#include <linux/errno.h>
18#include <linux/list.h> 19#include <linux/list.h>
19#include <linux/io.h> 20#include <linux/io.h>
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 962c2d8dd8d9..87991d3abbab 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -250,7 +250,7 @@ unlock:
250 raw_spin_unlock(&desc->lock); 250 raw_spin_unlock(&desc->lock);
251} 251}
252 252
253static int fsl_of_msi_remove(struct of_device *ofdev) 253static int fsl_of_msi_remove(struct platform_device *ofdev)
254{ 254{
255 struct fsl_msi *msi = ofdev->dev.platform_data; 255 struct fsl_msi *msi = ofdev->dev.platform_data;
256 int virq, i; 256 int virq, i;
@@ -274,7 +274,7 @@ static int fsl_of_msi_remove(struct of_device *ofdev)
274 return 0; 274 return 0;
275} 275}
276 276
277static int __devinit fsl_of_msi_probe(struct of_device *dev, 277static int __devinit fsl_of_msi_probe(struct platform_device *dev,
278 const struct of_device_id *match) 278 const struct of_device_id *match)
279{ 279{
280 struct fsl_msi *msi; 280 struct fsl_msi *msi;
diff --git a/arch/powerpc/sysdev/fsl_pmc.c b/arch/powerpc/sysdev/fsl_pmc.c
index 9082eb921ad9..44de8559c975 100644
--- a/arch/powerpc/sysdev/fsl_pmc.c
+++ b/arch/powerpc/sysdev/fsl_pmc.c
@@ -58,7 +58,8 @@ static struct platform_suspend_ops pmc_suspend_ops = {
58 .enter = pmc_suspend_enter, 58 .enter = pmc_suspend_enter,
59}; 59};
60 60
61static int pmc_probe(struct of_device *ofdev, const struct of_device_id *id) 61static int pmc_probe(struct platform_device *ofdev,
62 const struct of_device_id *id)
62{ 63{
63 pmc_regs = of_iomap(ofdev->dev.of_node, 0); 64 pmc_regs = of_iomap(ofdev->dev.of_node, 0);
64 if (!pmc_regs) 65 if (!pmc_regs)
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 30e1626b2e85..8bd86530ee25 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -1338,7 +1338,7 @@ static inline void fsl_rio_info(struct device *dev, u32 ccsr)
1338 * master port with system-specific info, and registers the 1338 * master port with system-specific info, and registers the
1339 * master port with the RapidIO subsystem. 1339 * master port with the RapidIO subsystem.
1340 */ 1340 */
1341int fsl_rio_setup(struct of_device *dev) 1341int fsl_rio_setup(struct platform_device *dev)
1342{ 1342{
1343 struct rio_ops *ops; 1343 struct rio_ops *ops;
1344 struct rio_mport *port; 1344 struct rio_mport *port;
@@ -1536,7 +1536,7 @@ err_ops:
1536 1536
1537/* The probe function for RapidIO peer-to-peer network. 1537/* The probe function for RapidIO peer-to-peer network.
1538 */ 1538 */
1539static int __devinit fsl_of_rio_rpn_probe(struct of_device *dev, 1539static int __devinit fsl_of_rio_rpn_probe(struct platform_device *dev,
1540 const struct of_device_id *match) 1540 const struct of_device_id *match)
1541{ 1541{
1542 int rc; 1542 int rc;
diff --git a/arch/powerpc/sysdev/mpc8xxx_gpio.c b/arch/powerpc/sysdev/mpc8xxx_gpio.c
index 83f519655fac..2b69084d0f0c 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,9 @@ 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;
279 gc->ngpio = MPC8XXX_GPIO_PINS; 276 gc->ngpio = MPC8XXX_GPIO_PINS;
280 gc->direction_input = mpc8xxx_gpio_dir_in; 277 gc->direction_input = mpc8xxx_gpio_dir_in;
281 gc->direction_output = mpc8xxx_gpio_dir_out; 278 gc->direction_output = mpc8xxx_gpio_dir_out;
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index 31acd3b1718b..1398bc454999 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -20,12 +20,7 @@
20 20
21#include <asm/prom.h> 21#include <asm/prom.h>
22 22
23/* 23/* These functions provide the necessary setup for the mv64x60 drivers. */
24 * These functions provide the necessary setup for the mv64x60 drivers.
25 * These drivers are unusual in that they work on both the MIPS and PowerPC
26 * architectures. Because of that, the drivers do not support the normal
27 * PowerPC of_platform_bus_type. They support platform_bus_type instead.
28 */
29 24
30static struct of_device_id __initdata of_mv64x60_devices[] = { 25static struct of_device_id __initdata of_mv64x60_devices[] = {
31 { .compatible = "marvell,mv64306-devctrl", }, 26 { .compatible = "marvell,mv64306-devctrl", },
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c
index d07137a07d75..24a0bb955b18 100644
--- a/arch/powerpc/sysdev/pmi.c
+++ b/arch/powerpc/sysdev/pmi.c
@@ -43,7 +43,7 @@ struct pmi_data {
43 struct mutex msg_mutex; 43 struct mutex msg_mutex;
44 pmi_message_t msg; 44 pmi_message_t msg;
45 struct completion *completion; 45 struct completion *completion;
46 struct of_device *dev; 46 struct platform_device *dev;
47 int irq; 47 int irq;
48 u8 __iomem *pmi_reg; 48 u8 __iomem *pmi_reg;
49 struct work_struct work; 49 struct work_struct work;
@@ -121,7 +121,7 @@ static void pmi_notify_handlers(struct work_struct *work)
121 spin_unlock(&data->handler_spinlock); 121 spin_unlock(&data->handler_spinlock);
122} 122}
123 123
124static int pmi_of_probe(struct of_device *dev, 124static int pmi_of_probe(struct platform_device *dev,
125 const struct of_device_id *match) 125 const struct of_device_id *match)
126{ 126{
127 struct device_node *np = dev->dev.of_node; 127 struct device_node *np = dev->dev.of_node;
@@ -185,7 +185,7 @@ out:
185 return rc; 185 return rc;
186} 186}
187 187
188static int pmi_of_remove(struct of_device *dev) 188static int pmi_of_remove(struct platform_device *dev)
189{ 189{
190 struct pmi_handler *handler, *tmp; 190 struct pmi_handler *handler, *tmp;
191 191
diff --git a/arch/powerpc/sysdev/ppc4xx_gpio.c b/arch/powerpc/sysdev/ppc4xx_gpio.c
index 3812fc366bec..fc65ad1b3293 100644
--- a/arch/powerpc/sysdev/ppc4xx_gpio.c
+++ b/arch/powerpc/sysdev/ppc4xx_gpio.c
@@ -181,7 +181,6 @@ static int __init ppc4xx_add_gpiochips(void)
181 int ret; 181 int ret;
182 struct ppc4xx_gpio_chip *ppc4xx_gc; 182 struct ppc4xx_gpio_chip *ppc4xx_gc;
183 struct of_mm_gpio_chip *mm_gc; 183 struct of_mm_gpio_chip *mm_gc;
184 struct of_gpio_chip *of_gc;
185 struct gpio_chip *gc; 184 struct gpio_chip *gc;
186 185
187 ppc4xx_gc = kzalloc(sizeof(*ppc4xx_gc), GFP_KERNEL); 186 ppc4xx_gc = kzalloc(sizeof(*ppc4xx_gc), GFP_KERNEL);
@@ -193,10 +192,8 @@ static int __init ppc4xx_add_gpiochips(void)
193 spin_lock_init(&ppc4xx_gc->lock); 192 spin_lock_init(&ppc4xx_gc->lock);
194 193
195 mm_gc = &ppc4xx_gc->mm_gc; 194 mm_gc = &ppc4xx_gc->mm_gc;
196 of_gc = &mm_gc->of_gc; 195 gc = &mm_gc->gc;
197 gc = &of_gc->gc;
198 196
199 of_gc->gpio_cells = 2;
200 gc->ngpio = 32; 197 gc->ngpio = 32;
201 gc->direction_input = ppc4xx_gpio_dir_in; 198 gc->direction_input = ppc4xx_gpio_dir_in;
202 gc->direction_output = ppc4xx_gpio_dir_out; 199 gc->direction_output = ppc4xx_gpio_dir_out;
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c
index dc8f8d618074..36bf845df127 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -138,8 +138,8 @@ struct qe_pin {
138struct qe_pin *qe_pin_request(struct device_node *np, int index) 138struct qe_pin *qe_pin_request(struct device_node *np, int index)
139{ 139{
140 struct qe_pin *qe_pin; 140 struct qe_pin *qe_pin;
141 struct device_node *gc; 141 struct device_node *gpio_np;
142 struct of_gpio_chip *of_gc = NULL; 142 struct gpio_chip *gc;
143 struct of_mm_gpio_chip *mm_gc; 143 struct of_mm_gpio_chip *mm_gc;
144 struct qe_gpio_chip *qe_gc; 144 struct qe_gpio_chip *qe_gc;
145 int err; 145 int err;
@@ -155,40 +155,40 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
155 } 155 }
156 156
157 err = of_parse_phandles_with_args(np, "gpios", "#gpio-cells", index, 157 err = of_parse_phandles_with_args(np, "gpios", "#gpio-cells", index,
158 &gc, &gpio_spec); 158 &gpio_np, &gpio_spec);
159 if (err) { 159 if (err) {
160 pr_debug("%s: can't parse gpios property\n", __func__); 160 pr_debug("%s: can't parse gpios property\n", __func__);
161 goto err0; 161 goto err0;
162 } 162 }
163 163
164 if (!of_device_is_compatible(gc, "fsl,mpc8323-qe-pario-bank")) { 164 if (!of_device_is_compatible(gpio_np, "fsl,mpc8323-qe-pario-bank")) {
165 pr_debug("%s: tried to get a non-qe pin\n", __func__); 165 pr_debug("%s: tried to get a non-qe pin\n", __func__);
166 err = -EINVAL; 166 err = -EINVAL;
167 goto err1; 167 goto err1;
168 } 168 }
169 169
170 of_gc = gc->data; 170 gc = of_node_to_gpiochip(gpio_np);
171 if (!of_gc) { 171 if (!gc) {
172 pr_debug("%s: gpio controller %s isn't registered\n", 172 pr_debug("%s: gpio controller %s isn't registered\n",
173 np->full_name, gc->full_name); 173 np->full_name, gpio_np->full_name);
174 err = -ENODEV; 174 err = -ENODEV;
175 goto err1; 175 goto err1;
176 } 176 }
177 177
178 gpio_cells = of_get_property(gc, "#gpio-cells", &size); 178 gpio_cells = of_get_property(gpio_np, "#gpio-cells", &size);
179 if (!gpio_cells || size != sizeof(*gpio_cells) || 179 if (!gpio_cells || size != sizeof(*gpio_cells) ||
180 *gpio_cells != of_gc->gpio_cells) { 180 *gpio_cells != gc->of_gpio_n_cells) {
181 pr_debug("%s: wrong #gpio-cells for %s\n", 181 pr_debug("%s: wrong #gpio-cells for %s\n",
182 np->full_name, gc->full_name); 182 np->full_name, gpio_np->full_name);
183 err = -EINVAL; 183 err = -EINVAL;
184 goto err1; 184 goto err1;
185 } 185 }
186 186
187 err = of_gc->xlate(of_gc, np, gpio_spec, NULL); 187 err = gc->of_xlate(gc, np, gpio_spec, NULL);
188 if (err < 0) 188 if (err < 0)
189 goto err1; 189 goto err1;
190 190
191 mm_gc = to_of_mm_gpio_chip(&of_gc->gc); 191 mm_gc = to_of_mm_gpio_chip(gc);
192 qe_gc = to_qe_gpio_chip(mm_gc); 192 qe_gc = to_qe_gpio_chip(mm_gc);
193 193
194 spin_lock_irqsave(&qe_gc->lock, flags); 194 spin_lock_irqsave(&qe_gc->lock, flags);
@@ -206,7 +206,7 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index)
206 if (!err) 206 if (!err)
207 return qe_pin; 207 return qe_pin;
208err1: 208err1:
209 of_node_put(gc); 209 of_node_put(gpio_np);
210err0: 210err0:
211 kfree(qe_pin); 211 kfree(qe_pin);
212 pr_debug("%s failed with status %d\n", __func__, err); 212 pr_debug("%s failed with status %d\n", __func__, err);
@@ -307,7 +307,6 @@ static int __init qe_add_gpiochips(void)
307 int ret; 307 int ret;
308 struct qe_gpio_chip *qe_gc; 308 struct qe_gpio_chip *qe_gc;
309 struct of_mm_gpio_chip *mm_gc; 309 struct of_mm_gpio_chip *mm_gc;
310 struct of_gpio_chip *of_gc;
311 struct gpio_chip *gc; 310 struct gpio_chip *gc;
312 311
313 qe_gc = kzalloc(sizeof(*qe_gc), GFP_KERNEL); 312 qe_gc = kzalloc(sizeof(*qe_gc), GFP_KERNEL);
@@ -319,11 +318,9 @@ static int __init qe_add_gpiochips(void)
319 spin_lock_init(&qe_gc->lock); 318 spin_lock_init(&qe_gc->lock);
320 319
321 mm_gc = &qe_gc->mm_gc; 320 mm_gc = &qe_gc->mm_gc;
322 of_gc = &mm_gc->of_gc; 321 gc = &mm_gc->gc;
323 gc = &of_gc->gc;
324 322
325 mm_gc->save_regs = qe_gpio_save_regs; 323 mm_gc->save_regs = qe_gpio_save_regs;
326 of_gc->gpio_cells = 2;
327 gc->ngpio = QE_PIO_PINS; 324 gc->ngpio = QE_PIO_PINS;
328 gc->direction_input = qe_gpio_dir_in; 325 gc->direction_input = qe_gpio_dir_in;
329 gc->direction_output = qe_gpio_dir_out; 326 gc->direction_output = qe_gpio_dir_out;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 093e0ae1a941..3da8014931c9 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -651,14 +651,15 @@ unsigned int qe_get_num_of_snums(void)
651EXPORT_SYMBOL(qe_get_num_of_snums); 651EXPORT_SYMBOL(qe_get_num_of_snums);
652 652
653#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx) 653#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC_85xx)
654static int qe_resume(struct of_device *ofdev) 654static int qe_resume(struct platform_device *ofdev)
655{ 655{
656 if (!qe_alive_during_sleep()) 656 if (!qe_alive_during_sleep())
657 qe_reset(); 657 qe_reset();
658 return 0; 658 return 0;
659} 659}
660 660
661static int qe_probe(struct of_device *ofdev, const struct of_device_id *id) 661static int qe_probe(struct platform_device *ofdev,
662 const struct of_device_id *id)
662{ 663{
663 return 0; 664 return 0;
664} 665}
diff --git a/arch/powerpc/sysdev/simple_gpio.c b/arch/powerpc/sysdev/simple_gpio.c
index d5fb173e588c..b6defda5ccc9 100644
--- a/arch/powerpc/sysdev/simple_gpio.c
+++ b/arch/powerpc/sysdev/simple_gpio.c
@@ -91,7 +91,6 @@ static int __init u8_simple_gpiochip_add(struct device_node *np)
91 int ret; 91 int ret;
92 struct u8_gpio_chip *u8_gc; 92 struct u8_gpio_chip *u8_gc;
93 struct of_mm_gpio_chip *mm_gc; 93 struct of_mm_gpio_chip *mm_gc;
94 struct of_gpio_chip *of_gc;
95 struct gpio_chip *gc; 94 struct gpio_chip *gc;
96 95
97 u8_gc = kzalloc(sizeof(*u8_gc), GFP_KERNEL); 96 u8_gc = kzalloc(sizeof(*u8_gc), GFP_KERNEL);
@@ -101,11 +100,9 @@ static int __init u8_simple_gpiochip_add(struct device_node *np)
101 spin_lock_init(&u8_gc->lock); 100 spin_lock_init(&u8_gc->lock);
102 101
103 mm_gc = &u8_gc->mm_gc; 102 mm_gc = &u8_gc->mm_gc;
104 of_gc = &mm_gc->of_gc; 103 gc = &mm_gc->gc;
105 gc = &of_gc->gc;
106 104
107 mm_gc->save_regs = u8_gpio_save_regs; 105 mm_gc->save_regs = u8_gpio_save_regs;
108 of_gc->gpio_cells = 2;
109 gc->ngpio = 8; 106 gc->ngpio = 8;
110 gc->direction_input = u8_gpio_dir_in; 107 gc->direction_input = u8_gpio_dir_in;
111 gc->direction_output = u8_gpio_dir_out; 108 gc->direction_output = u8_gpio_dir_out;