diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-01 12:50:33 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-24 05:37:36 -0400 |
commit | b4ac08492d06e4f2cea24a5b2579b4b0a0f537ce (patch) | |
tree | ae05498ea8feee6cc3fb1af8b74bbb0ccacbb88c /arch/arm/mach-rpc/ecard.c | |
parent | c402c110721ed53916595473aed1013acde95bab (diff) |
ARM: riscpc: convert ecard to use irq_alloc_descs()
Use irq_alloc_descs() to allocate IRQs for expansion cards.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-rpc/ecard.c')
-rw-r--r-- | arch/arm/mach-rpc/ecard.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index ec84cfde4ad7..1a6cfc8ca277 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/init.h> | 42 | #include <linux/init.h> |
43 | #include <linux/mutex.h> | 43 | #include <linux/mutex.h> |
44 | #include <linux/kthread.h> | 44 | #include <linux/kthread.h> |
45 | #include <linux/irq.h> | ||
45 | #include <linux/io.h> | 46 | #include <linux/io.h> |
46 | 47 | ||
47 | #include <asm/dma.h> | 48 | #include <asm/dma.h> |
@@ -977,8 +978,7 @@ EXPORT_SYMBOL(ecardm_iomap); | |||
977 | * If bit 1 of the first byte of the card is set, then the | 978 | * If bit 1 of the first byte of the card is set, then the |
978 | * card does not exist. | 979 | * card does not exist. |
979 | */ | 980 | */ |
980 | static int __init | 981 | static int __init ecard_probe(int slot, unsigned irq, card_type_t type) |
981 | ecard_probe(int slot, card_type_t type) | ||
982 | { | 982 | { |
983 | ecard_t **ecp; | 983 | ecard_t **ecp; |
984 | ecard_t *ec; | 984 | ecard_t *ec; |
@@ -1032,19 +1032,18 @@ ecard_probe(int slot, card_type_t type) | |||
1032 | break; | 1032 | break; |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | ec->irq = irq; | ||
1036 | |||
1035 | /* | 1037 | /* |
1036 | * hook the interrupt handlers | 1038 | * hook the interrupt handlers |
1037 | */ | 1039 | */ |
1038 | if (slot < 8) { | 1040 | if (slot < 8) { |
1039 | ec->irq = 32 + slot; | ||
1040 | irq_set_chip_and_handler(ec->irq, &ecard_chip, | 1041 | irq_set_chip_and_handler(ec->irq, &ecard_chip, |
1041 | handle_level_irq); | 1042 | handle_level_irq); |
1042 | irq_set_chip_data(ec->irq, ec); | 1043 | irq_set_chip_data(ec->irq, ec); |
1043 | set_irq_flags(ec->irq, IRQF_VALID); | 1044 | set_irq_flags(ec->irq, IRQF_VALID); |
1044 | } | 1045 | } |
1045 | 1046 | ||
1046 | if (slot == 8) | ||
1047 | ec->irq = 11; | ||
1048 | #ifdef CONFIG_ARCH_RPC | 1047 | #ifdef CONFIG_ARCH_RPC |
1049 | /* On RiscPC, only first two slots have DMA capability */ | 1048 | /* On RiscPC, only first two slots have DMA capability */ |
1050 | if (slot < 2) | 1049 | if (slot < 2) |
@@ -1074,23 +1073,28 @@ ecard_probe(int slot, card_type_t type) | |||
1074 | static int __init ecard_init(void) | 1073 | static int __init ecard_init(void) |
1075 | { | 1074 | { |
1076 | struct task_struct *task; | 1075 | struct task_struct *task; |
1077 | int slot, irqhw; | 1076 | int slot, irqhw, irqbase; |
1077 | |||
1078 | irqbase = irq_alloc_descs(-1, 0, 8, -1); | ||
1079 | if (irqbase < 0) | ||
1080 | return irqbase; | ||
1078 | 1081 | ||
1079 | task = kthread_run(ecard_task, NULL, "kecardd"); | 1082 | task = kthread_run(ecard_task, NULL, "kecardd"); |
1080 | if (IS_ERR(task)) { | 1083 | if (IS_ERR(task)) { |
1081 | printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n", | 1084 | printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n", |
1082 | PTR_ERR(task)); | 1085 | PTR_ERR(task)); |
1086 | irq_free_descs(irqbase, 8); | ||
1083 | return PTR_ERR(task); | 1087 | return PTR_ERR(task); |
1084 | } | 1088 | } |
1085 | 1089 | ||
1086 | printk("Probing expansion cards\n"); | 1090 | printk("Probing expansion cards\n"); |
1087 | 1091 | ||
1088 | for (slot = 0; slot < 8; slot ++) { | 1092 | for (slot = 0; slot < 8; slot ++) { |
1089 | if (ecard_probe(slot, ECARD_EASI) == -ENODEV) | 1093 | if (ecard_probe(slot, irqbase + slot, ECARD_EASI) == -ENODEV) |
1090 | ecard_probe(slot, ECARD_IOC); | 1094 | ecard_probe(slot, irqbase + slot, ECARD_IOC); |
1091 | } | 1095 | } |
1092 | 1096 | ||
1093 | ecard_probe(8, ECARD_IOC); | 1097 | ecard_probe(8, 11, ECARD_IOC); |
1094 | 1098 | ||
1095 | irqhw = ecard_probeirqhw(); | 1099 | irqhw = ecard_probeirqhw(); |
1096 | 1100 | ||