aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-24 18:05:08 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-09 10:34:16 -0500
commitb6bdfcf5ae634fcb9dce0c16972cf39d90be6f74 (patch)
tree0a4516b135fe86be5e89abdd9a7aba8f91933288
parentced8d21cf104c9924e98f78954e873577366d156 (diff)
ARM: sa11x0: neponset: get parent IRQ from neponset device resource
Obtain the parent IRQ from the neponset device resource rather than hard-coding it into the code. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-sa1100/neponset.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 47681960783b..f4d587151770 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -207,7 +207,11 @@ static int __devinit neponset_probe(struct platform_device *dev)
207 .res = smc91x_resources, 207 .res = smc91x_resources,
208 .num_res = ARRAY_SIZE(smc91x_resources), 208 .num_res = ARRAY_SIZE(smc91x_resources),
209 }; 209 };
210 int ret; 210 int ret, irq;
211
212 irq = ret = platform_get_irq(dev, 0);
213 if (ret < 0)
214 goto err_alloc;
211 215
212 d = kzalloc(sizeof(*d), GFP_KERNEL); 216 d = kzalloc(sizeof(*d), GFP_KERNEL);
213 if (!d) { 217 if (!d) {
@@ -234,16 +238,16 @@ static int __devinit neponset_probe(struct platform_device *dev)
234 set_irq_flags(d->irq_base + NEP_IRQ_USAR, IRQF_VALID | IRQF_PROBE); 238 set_irq_flags(d->irq_base + NEP_IRQ_USAR, IRQF_VALID | IRQF_PROBE);
235 irq_set_chip(d->irq_base + NEP_IRQ_SA1111, &nochip); 239 irq_set_chip(d->irq_base + NEP_IRQ_SA1111, &nochip);
236 240
237 irq_set_irq_type(IRQ_GPIO25, IRQ_TYPE_EDGE_RISING); 241 irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
238 irq_set_handler_data(IRQ_GPIO25, d); 242 irq_set_handler_data(irq, d);
239 irq_set_chained_handler(IRQ_GPIO25, neponset_irq_handler); 243 irq_set_chained_handler(irq, neponset_irq_handler);
240 244
241 /* 245 /*
242 * We would set IRQ_GPIO25 to be a wake-up IRQ, but unfortunately 246 * We would set IRQ_GPIO25 to be a wake-up IRQ, but unfortunately
243 * something on the Neponset activates this IRQ on sleep (eth?) 247 * something on the Neponset activates this IRQ on sleep (eth?)
244 */ 248 */
245#if 0 249#if 0
246 enable_irq_wake(IRQ_GPIO25); 250 enable_irq_wake(irq);
247#endif 251#endif
248 252
249 dev_info(&dev->dev, "Neponset daughter board, providing IRQ%u-%u\n", 253 dev_info(&dev->dev, "Neponset daughter board, providing IRQ%u-%u\n",
@@ -275,12 +279,13 @@ static int __devinit neponset_probe(struct platform_device *dev)
275static int __devexit neponset_remove(struct platform_device *dev) 279static int __devexit neponset_remove(struct platform_device *dev)
276{ 280{
277 struct neponset_drvdata *d = platform_get_drvdata(dev); 281 struct neponset_drvdata *d = platform_get_drvdata(dev);
282 int irq = platform_get_irq(dev, 0);
278 283
279 if (!IS_ERR(d->sa1111)) 284 if (!IS_ERR(d->sa1111))
280 platform_device_unregister(d->sa1111); 285 platform_device_unregister(d->sa1111);
281 if (!IS_ERR(d->smc91x)) 286 if (!IS_ERR(d->smc91x))
282 platform_device_unregister(d->smc91x); 287 platform_device_unregister(d->smc91x);
283 irq_set_chained_handler(IRQ_GPIO25, NULL); 288 irq_set_chained_handler(irq, NULL);
284 irq_free_descs(d->irq_base, NEP_IRQ_NR); 289 irq_free_descs(d->irq_base, NEP_IRQ_NR);
285 kfree(d); 290 kfree(d);
286 291
@@ -325,7 +330,8 @@ static struct platform_driver neponset_device_driver = {
325}; 330};
326 331
327static struct resource neponset_resources[] = { 332static struct resource neponset_resources[] = {
328 [0] = DEFINE_RES_MEM(0x10000000, 0x08000000), 333 DEFINE_RES_MEM(0x10000000, 0x08000000),
334 DEFINE_RES_IRQ(IRQ_GPIO25),
329}; 335};
330 336
331static struct platform_device neponset_device = { 337static struct platform_device neponset_device = {