diff options
Diffstat (limited to 'arch/arm/kernel/ecard.c')
-rw-r--r-- | arch/arm/kernel/ecard.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index f1c0fb974177..bdbd7da99286 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
42 | #include <linux/mutex.h> | 42 | #include <linux/mutex.h> |
43 | #include <linux/kthread.h> | ||
43 | 44 | ||
44 | #include <asm/dma.h> | 45 | #include <asm/dma.h> |
45 | #include <asm/ecard.h> | 46 | #include <asm/ecard.h> |
@@ -50,6 +51,8 @@ | |||
50 | #include <asm/mach/irq.h> | 51 | #include <asm/mach/irq.h> |
51 | #include <asm/tlbflush.h> | 52 | #include <asm/tlbflush.h> |
52 | 53 | ||
54 | #include "ecard.h" | ||
55 | |||
53 | #ifndef CONFIG_ARCH_RPC | 56 | #ifndef CONFIG_ARCH_RPC |
54 | #define HAVE_EXPMASK | 57 | #define HAVE_EXPMASK |
55 | #endif | 58 | #endif |
@@ -123,7 +126,7 @@ static void ecard_task_reset(struct ecard_request *req) | |||
123 | 126 | ||
124 | res = ec->slot_no == 8 | 127 | res = ec->slot_no == 8 |
125 | ? &ec->resource[ECARD_RES_MEMC] | 128 | ? &ec->resource[ECARD_RES_MEMC] |
126 | : ec->type == ECARD_EASI | 129 | : ec->easi |
127 | ? &ec->resource[ECARD_RES_EASI] | 130 | ? &ec->resource[ECARD_RES_EASI] |
128 | : &ec->resource[ECARD_RES_IOCSYNC]; | 131 | : &ec->resource[ECARD_RES_IOCSYNC]; |
129 | 132 | ||
@@ -178,7 +181,7 @@ static void ecard_task_readbytes(struct ecard_request *req) | |||
178 | index += 1; | 181 | index += 1; |
179 | } | 182 | } |
180 | } else { | 183 | } else { |
181 | unsigned long base = (ec->type == ECARD_EASI | 184 | unsigned long base = (ec->easi |
182 | ? &ec->resource[ECARD_RES_EASI] | 185 | ? &ec->resource[ECARD_RES_EASI] |
183 | : &ec->resource[ECARD_RES_IOCSYNC])->start; | 186 | : &ec->resource[ECARD_RES_IOCSYNC])->start; |
184 | void __iomem *pbase = (void __iomem *)base; | 187 | void __iomem *pbase = (void __iomem *)base; |
@@ -263,8 +266,6 @@ static int ecard_init_mm(void) | |||
263 | static int | 266 | static int |
264 | ecard_task(void * unused) | 267 | ecard_task(void * unused) |
265 | { | 268 | { |
266 | daemonize("kecardd"); | ||
267 | |||
268 | /* | 269 | /* |
269 | * Allocate a mm. We're not a lazy-TLB kernel task since we need | 270 | * Allocate a mm. We're not a lazy-TLB kernel task since we need |
270 | * to set page table entries where the user space would be. Note | 271 | * to set page table entries where the user space would be. Note |
@@ -727,7 +728,7 @@ static int ecard_prints(char *buffer, ecard_t *ec) | |||
727 | char *start = buffer; | 728 | char *start = buffer; |
728 | 729 | ||
729 | buffer += sprintf(buffer, " %d: %s ", ec->slot_no, | 730 | buffer += sprintf(buffer, " %d: %s ", ec->slot_no, |
730 | ec->type == ECARD_EASI ? "EASI" : " "); | 731 | ec->easi ? "EASI" : " "); |
731 | 732 | ||
732 | if (ec->cid.id == 0) { | 733 | if (ec->cid.id == 0) { |
733 | struct in_chunk_dir incd; | 734 | struct in_chunk_dir incd; |
@@ -814,7 +815,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot) | |||
814 | } | 815 | } |
815 | 816 | ||
816 | ec->slot_no = slot; | 817 | ec->slot_no = slot; |
817 | ec->type = type; | 818 | ec->easi = type == ECARD_EASI; |
818 | ec->irq = NO_IRQ; | 819 | ec->irq = NO_IRQ; |
819 | ec->fiq = NO_IRQ; | 820 | ec->fiq = NO_IRQ; |
820 | ec->dma = NO_DMA; | 821 | ec->dma = NO_DMA; |
@@ -825,6 +826,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot) | |||
825 | ec->dev.bus = &ecard_bus_type; | 826 | ec->dev.bus = &ecard_bus_type; |
826 | ec->dev.dma_mask = &ec->dma_mask; | 827 | ec->dev.dma_mask = &ec->dma_mask; |
827 | ec->dma_mask = (u64)0xffffffff; | 828 | ec->dma_mask = (u64)0xffffffff; |
829 | ec->dev.coherent_dma_mask = ec->dma_mask; | ||
828 | 830 | ||
829 | if (slot < 4) { | 831 | if (slot < 4) { |
830 | ec_set_resource(ec, ECARD_RES_MEMC, | 832 | ec_set_resource(ec, ECARD_RES_MEMC, |
@@ -907,7 +909,7 @@ static ssize_t ecard_show_device(struct device *dev, struct device_attribute *at | |||
907 | static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf) | 909 | static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf) |
908 | { | 910 | { |
909 | struct expansion_card *ec = ECARD_DEV(dev); | 911 | struct expansion_card *ec = ECARD_DEV(dev); |
910 | return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC"); | 912 | return sprintf(buf, "%s\n", ec->easi ? "EASI" : "IOC"); |
911 | } | 913 | } |
912 | 914 | ||
913 | static struct device_attribute ecard_dev_attrs[] = { | 915 | static struct device_attribute ecard_dev_attrs[] = { |
@@ -1058,13 +1060,14 @@ ecard_probe(int slot, card_type_t type) | |||
1058 | */ | 1060 | */ |
1059 | static int __init ecard_init(void) | 1061 | static int __init ecard_init(void) |
1060 | { | 1062 | { |
1061 | int slot, irqhw, ret; | 1063 | struct task_struct *task; |
1062 | 1064 | int slot, irqhw; | |
1063 | ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL); | 1065 | |
1064 | if (ret < 0) { | 1066 | task = kthread_run(ecard_task, NULL, "kecardd"); |
1065 | printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n", | 1067 | if (IS_ERR(task)) { |
1066 | ret); | 1068 | printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n", |
1067 | return ret; | 1069 | PTR_ERR(task)); |
1070 | return PTR_ERR(task); | ||
1068 | } | 1071 | } |
1069 | 1072 | ||
1070 | printk("Probing expansion cards\n"); | 1073 | printk("Probing expansion cards\n"); |