diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-17 16:54:29 -0400 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-17 16:54:29 -0400 | 
| commit | ba2e1c5f25a99dec3873745031ad23ce3fd79bff (patch) | |
| tree | ebcc8e9b0f395033e8ba1db8e30fb6ea78edc442 | |
| parent | 7d32c0aca4fbd0319c860d12af5fae3e88c760e6 (diff) | |
| parent | 92183b346f02773dae09182c65f16b013f295d80 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k: amiga - Floppy platform device conversion
  m68k: amiga - Sound platform device conversion
  m68k: amiga - Frame buffer platform device conversion
  m68k: amiga - Zorro host bridge platform device conversion
  m68k: amiga - Zorro bus modalias support
  platform: Make platform resource input parameters const
  m68k: invoke oom-killer from page fault
  serial167: Kill unused variables
  m68k: Implement generic_find_next_{zero_,}le_bit()
  m68k: hp300 - Checkpatch cleanup
  m68k: Remove trailing spaces in messages
  m68k: Simplify param.h by using <asm-generic/param.h>
  m68k: Remove BKL from rtc implementations
31 files changed, 405 insertions, 285 deletions
| diff --git a/arch/m68k/amiga/Makefile b/arch/m68k/amiga/Makefile index 6a0d7650f980..11dd30b16b3b 100644 --- a/arch/m68k/amiga/Makefile +++ b/arch/m68k/amiga/Makefile | |||
| @@ -2,6 +2,6 @@ | |||
| 2 | # Makefile for Linux arch/m68k/amiga source directory | 2 | # Makefile for Linux arch/m68k/amiga source directory | 
| 3 | # | 3 | # | 
| 4 | 4 | ||
| 5 | obj-y := config.o amiints.o cia.o chipram.o amisound.o | 5 | obj-y := config.o amiints.o cia.o chipram.o amisound.o platform.o | 
| 6 | 6 | ||
| 7 | obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o | 7 | obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o | 
| diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c new file mode 100644 index 000000000000..38f18bf14737 --- /dev/null +++ b/arch/m68k/amiga/platform.c | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007-2009 Geert Uytterhoeven | ||
| 3 | * | ||
| 4 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 5 | * License. See the file COPYING in the main directory of this archive | ||
| 6 | * for more details. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <linux/init.h> | ||
| 10 | #include <linux/platform_device.h> | ||
| 11 | #include <linux/zorro.h> | ||
| 12 | |||
| 13 | #include <asm/amigahw.h> | ||
| 14 | |||
| 15 | |||
| 16 | #ifdef CONFIG_ZORRO | ||
| 17 | |||
| 18 | static const struct resource zorro_resources[] __initconst = { | ||
| 19 | /* Zorro II regions (on Zorro II/III) */ | ||
| 20 | { | ||
| 21 | .name = "Zorro II exp", | ||
| 22 | .start = 0x00e80000, | ||
| 23 | .end = 0x00efffff, | ||
| 24 | .flags = IORESOURCE_MEM, | ||
| 25 | }, { | ||
| 26 | .name = "Zorro II mem", | ||
| 27 | .start = 0x00200000, | ||
| 28 | .end = 0x009fffff, | ||
| 29 | .flags = IORESOURCE_MEM, | ||
| 30 | }, | ||
| 31 | /* Zorro III regions (on Zorro III only) */ | ||
| 32 | { | ||
| 33 | .name = "Zorro III exp", | ||
| 34 | .start = 0xff000000, | ||
| 35 | .end = 0xffffffff, | ||
| 36 | .flags = IORESOURCE_MEM, | ||
| 37 | }, { | ||
| 38 | .name = "Zorro III cfg", | ||
| 39 | .start = 0x40000000, | ||
| 40 | .end = 0x7fffffff, | ||
| 41 | .flags = IORESOURCE_MEM, | ||
| 42 | } | ||
| 43 | }; | ||
| 44 | |||
| 45 | |||
| 46 | static int __init amiga_init_bus(void) | ||
| 47 | { | ||
| 48 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) | ||
| 49 | return -ENODEV; | ||
| 50 | |||
| 51 | platform_device_register_simple("amiga-zorro", -1, zorro_resources, | ||
| 52 | AMIGAHW_PRESENT(ZORRO3) ? 4 : 2); | ||
| 53 | return 0; | ||
| 54 | } | ||
| 55 | |||
| 56 | subsys_initcall(amiga_init_bus); | ||
| 57 | |||
| 58 | #endif /* CONFIG_ZORRO */ | ||
| 59 | |||
| 60 | |||
| 61 | static int __init amiga_init_devices(void) | ||
| 62 | { | ||
| 63 | if (!MACH_IS_AMIGA) | ||
| 64 | return -ENODEV; | ||
| 65 | |||
| 66 | /* video hardware */ | ||
| 67 | if (AMIGAHW_PRESENT(AMI_VIDEO)) | ||
| 68 | platform_device_register_simple("amiga-video", -1, NULL, 0); | ||
| 69 | |||
| 70 | |||
| 71 | /* sound hardware */ | ||
| 72 | if (AMIGAHW_PRESENT(AMI_AUDIO)) | ||
| 73 | platform_device_register_simple("amiga-audio", -1, NULL, 0); | ||
| 74 | |||
| 75 | |||
| 76 | /* storage interfaces */ | ||
| 77 | if (AMIGAHW_PRESENT(AMI_FLOPPY)) | ||
| 78 | platform_device_register_simple("amiga-floppy", -1, NULL, 0); | ||
| 79 | |||
| 80 | return 0; | ||
| 81 | } | ||
| 82 | |||
| 83 | device_initcall(amiga_init_devices); | ||
| diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index b46ea1714a89..cb8617bb194b 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/types.h> | 9 | #include <linux/types.h> | 
| 10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> | 
| 11 | #include <linux/miscdevice.h> | 11 | #include <linux/miscdevice.h> | 
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/ioport.h> | 12 | #include <linux/ioport.h> | 
| 14 | #include <linux/capability.h> | 13 | #include <linux/capability.h> | 
| 15 | #include <linux/fcntl.h> | 14 | #include <linux/fcntl.h> | 
| @@ -35,10 +34,9 @@ | |||
| 35 | static unsigned char days_in_mo[] = | 34 | static unsigned char days_in_mo[] = | 
| 36 | {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | 35 | {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | 
| 37 | 36 | ||
| 38 | static char rtc_status; | 37 | static atomic_t rtc_status = ATOMIC_INIT(1); | 
| 39 | 38 | ||
| 40 | static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 39 | static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 
| 41 | unsigned long arg) | ||
| 42 | { | 40 | { | 
| 43 | volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; | 41 | volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; | 
| 44 | unsigned char msr; | 42 | unsigned char msr; | 
| @@ -132,29 +130,20 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
| 132 | } | 130 | } | 
| 133 | 131 | ||
| 134 | /* | 132 | /* | 
| 135 | * We enforce only one user at a time here with the open/close. | 133 | * We enforce only one user at a time here with the open/close. | 
| 136 | * Also clear the previous interrupt data on an open, and clean | ||
| 137 | * up things on a close. | ||
| 138 | */ | 134 | */ | 
| 139 | |||
| 140 | static int rtc_open(struct inode *inode, struct file *file) | 135 | static int rtc_open(struct inode *inode, struct file *file) | 
| 141 | { | 136 | { | 
| 142 | lock_kernel(); | 137 | if (!atomic_dec_and_test(&rtc_status)) { | 
| 143 | if(rtc_status) { | 138 | atomic_inc(&rtc_status); | 
| 144 | unlock_kernel(); | ||
| 145 | return -EBUSY; | 139 | return -EBUSY; | 
| 146 | } | 140 | } | 
| 147 | |||
| 148 | rtc_status = 1; | ||
| 149 | unlock_kernel(); | ||
| 150 | return 0; | 141 | return 0; | 
| 151 | } | 142 | } | 
| 152 | 143 | ||
| 153 | static int rtc_release(struct inode *inode, struct file *file) | 144 | static int rtc_release(struct inode *inode, struct file *file) | 
| 154 | { | 145 | { | 
| 155 | lock_kernel(); | 146 | atomic_inc(&rtc_status); | 
| 156 | rtc_status = 0; | ||
| 157 | unlock_kernel(); | ||
| 158 | return 0; | 147 | return 0; | 
| 159 | } | 148 | } | 
| 160 | 149 | ||
| @@ -163,9 +152,9 @@ static int rtc_release(struct inode *inode, struct file *file) | |||
| 163 | */ | 152 | */ | 
| 164 | 153 | ||
| 165 | static const struct file_operations rtc_fops = { | 154 | static const struct file_operations rtc_fops = { | 
| 166 | .ioctl = rtc_ioctl, | 155 | .unlocked_ioctl = rtc_ioctl, | 
| 167 | .open = rtc_open, | 156 | .open = rtc_open, | 
| 168 | .release = rtc_release, | 157 | .release = rtc_release, | 
| 169 | }; | 158 | }; | 
| 170 | 159 | ||
| 171 | static struct miscdevice rtc_dev = { | 160 | static struct miscdevice rtc_dev = { | 
| diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h index f5b3d098b0f5..7b98242960de 100644 --- a/arch/m68k/hp300/time.h +++ b/arch/m68k/hp300/time.h | |||
| @@ -1,4 +1,2 @@ | |||
| 1 | extern void hp300_sched_init(irq_handler_t vector); | 1 | extern void hp300_sched_init(irq_handler_t vector); | 
| 2 | extern unsigned long hp300_gettimeoffset (void); | 2 | extern unsigned long hp300_gettimeoffset(void); | 
| 3 | |||
| 4 | |||
| diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h index 9bde784e7bad..b4ecdaada520 100644 --- a/arch/m68k/include/asm/bitops_mm.h +++ b/arch/m68k/include/asm/bitops_mm.h | |||
| @@ -365,6 +365,10 @@ static inline int minix_test_bit(int nr, const void *vaddr) | |||
| 365 | #define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) | 365 | #define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) | 
| 366 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) | 366 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) | 
| 367 | #define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) | 367 | #define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) | 
| 368 | #define ext2_find_next_zero_bit(addr, size, offset) \ | ||
| 369 | generic_find_next_zero_le_bit((unsigned long *)addr, size, offset) | ||
| 370 | #define ext2_find_next_bit(addr, size, offset) \ | ||
| 371 | generic_find_next_le_bit((unsigned long *)addr, size, offset) | ||
| 368 | 372 | ||
| 369 | static inline int ext2_test_bit(int nr, const void *vaddr) | 373 | static inline int ext2_test_bit(int nr, const void *vaddr) | 
| 370 | { | 374 | { | 
| @@ -394,10 +398,9 @@ static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size) | |||
| 394 | return (p - addr) * 32 + res; | 398 | return (p - addr) * 32 + res; | 
| 395 | } | 399 | } | 
| 396 | 400 | ||
| 397 | static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size, | 401 | static inline unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, | 
| 398 | unsigned offset) | 402 | unsigned long size, unsigned long offset) | 
| 399 | { | 403 | { | 
| 400 | const unsigned long *addr = vaddr; | ||
| 401 | const unsigned long *p = addr + (offset >> 5); | 404 | const unsigned long *p = addr + (offset >> 5); | 
| 402 | int bit = offset & 31UL, res; | 405 | int bit = offset & 31UL, res; | 
| 403 | 406 | ||
| @@ -437,10 +440,9 @@ static inline int ext2_find_first_bit(const void *vaddr, unsigned size) | |||
| 437 | return (p - addr) * 32 + res; | 440 | return (p - addr) * 32 + res; | 
| 438 | } | 441 | } | 
| 439 | 442 | ||
| 440 | static inline int ext2_find_next_bit(const void *vaddr, unsigned size, | 443 | static inline unsigned long generic_find_next_le_bit(const unsigned long *addr, | 
| 441 | unsigned offset) | 444 | unsigned long size, unsigned long offset) | 
| 442 | { | 445 | { | 
| 443 | const unsigned long *addr = vaddr; | ||
| 444 | const unsigned long *p = addr + (offset >> 5); | 446 | const unsigned long *p = addr + (offset >> 5); | 
| 445 | int bit = offset & 31UL, res; | 447 | int bit = offset & 31UL, res; | 
| 446 | 448 | ||
| diff --git a/arch/m68k/include/asm/param.h b/arch/m68k/include/asm/param.h index 85c41b75aa78..36265ccf5c7b 100644 --- a/arch/m68k/include/asm/param.h +++ b/arch/m68k/include/asm/param.h | |||
| @@ -1,26 +1,12 @@ | |||
| 1 | #ifndef _M68K_PARAM_H | 1 | #ifndef _M68K_PARAM_H | 
| 2 | #define _M68K_PARAM_H | 2 | #define _M68K_PARAM_H | 
| 3 | 3 | ||
| 4 | #ifdef __KERNEL__ | ||
| 5 | # define HZ CONFIG_HZ /* Internal kernel timer frequency */ | ||
| 6 | # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ | ||
| 7 | # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #ifndef HZ | ||
| 11 | #define HZ 100 | ||
| 12 | #endif | ||
| 13 | |||
| 14 | #ifdef __uClinux__ | 4 | #ifdef __uClinux__ | 
| 15 | #define EXEC_PAGESIZE 4096 | 5 | #define EXEC_PAGESIZE 4096 | 
| 16 | #else | 6 | #else | 
| 17 | #define EXEC_PAGESIZE 8192 | 7 | #define EXEC_PAGESIZE 8192 | 
| 18 | #endif | 8 | #endif | 
| 19 | 9 | ||
| 20 | #ifndef NOGROUP | 10 | #include <asm-generic/param.h> | 
| 21 | #define NOGROUP (-1) | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
| 25 | 11 | ||
| 26 | #endif /* _M68K_PARAM_H */ | 12 | #endif /* _M68K_PARAM_H */ | 
| diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index aacd6d17b833..ada4f4cca811 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c | |||
| @@ -455,7 +455,7 @@ static inline void access_error040(struct frame *fp) | |||
| 455 | 455 | ||
| 456 | if (do_page_fault(&fp->ptregs, addr, errorcode)) { | 456 | if (do_page_fault(&fp->ptregs, addr, errorcode)) { | 
| 457 | #ifdef DEBUG | 457 | #ifdef DEBUG | 
| 458 | printk("do_page_fault() !=0 \n"); | 458 | printk("do_page_fault() !=0\n"); | 
| 459 | #endif | 459 | #endif | 
| 460 | if (user_mode(&fp->ptregs)){ | 460 | if (user_mode(&fp->ptregs)){ | 
| 461 | /* delay writebacks after signal delivery */ | 461 | /* delay writebacks after signal delivery */ | 
| diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 0356da9bf763..1c16b1baf8db 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
| @@ -148,7 +148,7 @@ static void mac_cache_card_flush(int writeback) | |||
| 148 | void __init config_mac(void) | 148 | void __init config_mac(void) | 
| 149 | { | 149 | { | 
| 150 | if (!MACH_IS_MAC) | 150 | if (!MACH_IS_MAC) | 
| 151 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); | 151 | printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n"); | 
| 152 | 152 | ||
| 153 | mach_sched_init = mac_sched_init; | 153 | mach_sched_init = mac_sched_init; | 
| 154 | mach_init_IRQ = mac_init_IRQ; | 154 | mach_init_IRQ = mac_init_IRQ; | 
| @@ -867,7 +867,7 @@ static void __init mac_identify(void) | |||
| 867 | */ | 867 | */ | 
| 868 | iop_preinit(); | 868 | iop_preinit(); | 
| 869 | 869 | ||
| 870 | printk(KERN_INFO "Detected Macintosh model: %d \n", model); | 870 | printk(KERN_INFO "Detected Macintosh model: %d\n", model); | 
| 871 | 871 | ||
| 872 | /* | 872 | /* | 
| 873 | * Report booter data: | 873 | * Report booter data: | 
| @@ -878,12 +878,12 @@ static void __init mac_identify(void) | |||
| 878 | mac_bi_data.videoaddr, mac_bi_data.videorow, | 878 | mac_bi_data.videoaddr, mac_bi_data.videorow, | 
| 879 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, | 879 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, | 
| 880 | mac_bi_data.dimensions >> 16); | 880 | mac_bi_data.dimensions >> 16); | 
| 881 | printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", | 881 | printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n", | 
| 882 | mac_bi_data.videological, mac_orig_videoaddr, | 882 | mac_bi_data.videological, mac_orig_videoaddr, | 
| 883 | mac_bi_data.sccbase); | 883 | mac_bi_data.sccbase); | 
| 884 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", | 884 | printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n", | 
| 885 | mac_bi_data.boottime, mac_bi_data.gmtbias); | 885 | mac_bi_data.boottime, mac_bi_data.gmtbias); | 
| 886 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", | 886 | printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n", | 
| 887 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); | 887 | mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); | 
| 888 | 888 | ||
| 889 | iop_init(); | 889 | iop_init(); | 
| diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index d0e35cf99fc6..a96394a0333d 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c | |||
| @@ -154,7 +154,6 @@ good_area: | |||
| 154 | * the fault. | 154 | * the fault. | 
| 155 | */ | 155 | */ | 
| 156 | 156 | ||
| 157 | survive: | ||
| 158 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); | 157 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); | 
| 159 | #ifdef DEBUG | 158 | #ifdef DEBUG | 
| 160 | printk("handle_mm_fault returns %d\n",fault); | 159 | printk("handle_mm_fault returns %d\n",fault); | 
| @@ -180,15 +179,10 @@ good_area: | |||
| 180 | */ | 179 | */ | 
| 181 | out_of_memory: | 180 | out_of_memory: | 
| 182 | up_read(&mm->mmap_sem); | 181 | up_read(&mm->mmap_sem); | 
| 183 | if (is_global_init(current)) { | 182 | if (!user_mode(regs)) | 
| 184 | yield(); | 183 | goto no_context; | 
| 185 | down_read(&mm->mmap_sem); | 184 | pagefault_out_of_memory(); | 
| 186 | goto survive; | 185 | return 0; | 
| 187 | } | ||
| 188 | |||
| 189 | printk("VM: killing process %s\n", current->comm); | ||
| 190 | if (user_mode(regs)) | ||
| 191 | do_group_exit(SIGKILL); | ||
| 192 | 186 | ||
| 193 | no_context: | 187 | no_context: | 
| 194 | current->thread.signo = SIGBUS; | 188 | current->thread.signo = SIGBUS; | 
| diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index 8da9c250d3e1..11ac6f63967a 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/types.h> | 9 | #include <linux/types.h> | 
| 10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> | 
| 11 | #include <linux/miscdevice.h> | 11 | #include <linux/miscdevice.h> | 
| 12 | #include <linux/smp_lock.h> | ||
| 13 | #include <linux/ioport.h> | 12 | #include <linux/ioport.h> | 
| 14 | #include <linux/capability.h> | 13 | #include <linux/capability.h> | 
| 15 | #include <linux/fcntl.h> | 14 | #include <linux/fcntl.h> | 
| @@ -36,8 +35,7 @@ static const unsigned char days_in_mo[] = | |||
| 36 | 35 | ||
| 37 | static atomic_t rtc_ready = ATOMIC_INIT(1); | 36 | static atomic_t rtc_ready = ATOMIC_INIT(1); | 
| 38 | 37 | ||
| 39 | static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 38 | static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 
| 40 | unsigned long arg) | ||
| 41 | { | 39 | { | 
| 42 | volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; | 40 | volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; | 
| 43 | unsigned long flags; | 41 | unsigned long flags; | 
| @@ -120,22 +118,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
| 120 | } | 118 | } | 
| 121 | 119 | ||
| 122 | /* | 120 | /* | 
| 123 | * We enforce only one user at a time here with the open/close. | 121 | * We enforce only one user at a time here with the open/close. | 
| 124 | * Also clear the previous interrupt data on an open, and clean | ||
| 125 | * up things on a close. | ||
| 126 | */ | 122 | */ | 
| 127 | |||
| 128 | static int rtc_open(struct inode *inode, struct file *file) | 123 | static int rtc_open(struct inode *inode, struct file *file) | 
| 129 | { | 124 | { | 
| 130 | lock_kernel(); | ||
| 131 | if( !atomic_dec_and_test(&rtc_ready) ) | 125 | if( !atomic_dec_and_test(&rtc_ready) ) | 
| 132 | { | 126 | { | 
| 133 | atomic_inc( &rtc_ready ); | 127 | atomic_inc( &rtc_ready ); | 
| 134 | unlock_kernel(); | ||
| 135 | return -EBUSY; | 128 | return -EBUSY; | 
| 136 | } | 129 | } | 
| 137 | unlock_kernel(); | ||
| 138 | |||
| 139 | return 0; | 130 | return 0; | 
| 140 | } | 131 | } | 
| 141 | 132 | ||
| @@ -150,9 +141,9 @@ static int rtc_release(struct inode *inode, struct file *file) | |||
| 150 | */ | 141 | */ | 
| 151 | 142 | ||
| 152 | static const struct file_operations rtc_fops = { | 143 | static const struct file_operations rtc_fops = { | 
| 153 | .ioctl = rtc_ioctl, | 144 | .unlocked_ioctl = rtc_ioctl, | 
| 154 | .open = rtc_open, | 145 | .open = rtc_open, | 
| 155 | .release = rtc_release, | 146 | .release = rtc_release, | 
| 156 | }; | 147 | }; | 
| 157 | 148 | ||
| 158 | static struct miscdevice rtc_dev= | 149 | static struct miscdevice rtc_dev= | 
| diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 31ab3f08bbda..ad10fecec2fe 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c | |||
| @@ -126,7 +126,7 @@ static void q40_reset(void) | |||
| 126 | { | 126 | { | 
| 127 | halted = 1; | 127 | halted = 1; | 
| 128 | printk("\n\n*******************************************\n" | 128 | printk("\n\n*******************************************\n" | 
| 129 | "Called q40_reset : press the RESET button!! \n" | 129 | "Called q40_reset : press the RESET button!!\n" | 
| 130 | "*******************************************\n"); | 130 | "*******************************************\n"); | 
| 131 | Q40_LED_ON(); | 131 | Q40_LED_ON(); | 
| 132 | while (1) | 132 | while (1) | 
| diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4b4b565c835f..c5fbe198fbdb 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -187,7 +187,7 @@ EXPORT_SYMBOL_GPL(platform_device_alloc); | |||
| 187 | * released. | 187 | * released. | 
| 188 | */ | 188 | */ | 
| 189 | int platform_device_add_resources(struct platform_device *pdev, | 189 | int platform_device_add_resources(struct platform_device *pdev, | 
| 190 | struct resource *res, unsigned int num) | 190 | const struct resource *res, unsigned int num) | 
| 191 | { | 191 | { | 
| 192 | struct resource *r; | 192 | struct resource *r; | 
| 193 | 193 | ||
| @@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister); | |||
| 367 | */ | 367 | */ | 
| 368 | struct platform_device *platform_device_register_simple(const char *name, | 368 | struct platform_device *platform_device_register_simple(const char *name, | 
| 369 | int id, | 369 | int id, | 
| 370 | struct resource *res, | 370 | const struct resource *res, | 
| 371 | unsigned int num) | 371 | unsigned int num) | 
| 372 | { | 372 | { | 
| 373 | struct platform_device *pdev; | 373 | struct platform_device *pdev; | 
| diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 0182a22c423a..832798aa14f6 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c | |||
| @@ -66,6 +66,7 @@ | |||
| 66 | #include <linux/blkdev.h> | 66 | #include <linux/blkdev.h> | 
| 67 | #include <linux/elevator.h> | 67 | #include <linux/elevator.h> | 
| 68 | #include <linux/interrupt.h> | 68 | #include <linux/interrupt.h> | 
| 69 | #include <linux/platform_device.h> | ||
| 69 | 70 | ||
| 70 | #include <asm/setup.h> | 71 | #include <asm/setup.h> | 
| 71 | #include <asm/uaccess.h> | 72 | #include <asm/uaccess.h> | 
| @@ -1696,34 +1697,18 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data) | |||
| 1696 | return get_disk(unit[drive].gendisk); | 1697 | return get_disk(unit[drive].gendisk); | 
| 1697 | } | 1698 | } | 
| 1698 | 1699 | ||
| 1699 | static int __init amiga_floppy_init(void) | 1700 | static int __init amiga_floppy_probe(struct platform_device *pdev) | 
| 1700 | { | 1701 | { | 
| 1701 | int i, ret; | 1702 | int i, ret; | 
| 1702 | 1703 | ||
| 1703 | if (!MACH_IS_AMIGA) | ||
| 1704 | return -ENODEV; | ||
| 1705 | |||
| 1706 | if (!AMIGAHW_PRESENT(AMI_FLOPPY)) | ||
| 1707 | return -ENODEV; | ||
| 1708 | |||
| 1709 | if (register_blkdev(FLOPPY_MAJOR,"fd")) | 1704 | if (register_blkdev(FLOPPY_MAJOR,"fd")) | 
| 1710 | return -EBUSY; | 1705 | return -EBUSY; | 
| 1711 | 1706 | ||
| 1712 | /* | ||
| 1713 | * We request DSKPTR, DSKLEN and DSKDATA only, because the other | ||
| 1714 | * floppy registers are too spreaded over the custom register space | ||
| 1715 | */ | ||
| 1716 | ret = -EBUSY; | ||
| 1717 | if (!request_mem_region(CUSTOM_PHYSADDR+0x20, 8, "amiflop [Paula]")) { | ||
| 1718 | printk("fd: cannot get floppy registers\n"); | ||
| 1719 | goto out_blkdev; | ||
| 1720 | } | ||
| 1721 | |||
| 1722 | ret = -ENOMEM; | 1707 | ret = -ENOMEM; | 
| 1723 | if ((raw_buf = (char *)amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) == | 1708 | if ((raw_buf = (char *)amiga_chip_alloc (RAW_BUF_SIZE, "Floppy")) == | 
| 1724 | NULL) { | 1709 | NULL) { | 
| 1725 | printk("fd: cannot get chip mem buffer\n"); | 1710 | printk("fd: cannot get chip mem buffer\n"); | 
| 1726 | goto out_memregion; | 1711 | goto out_blkdev; | 
| 1727 | } | 1712 | } | 
| 1728 | 1713 | ||
| 1729 | ret = -EBUSY; | 1714 | ret = -EBUSY; | 
| @@ -1792,18 +1777,13 @@ out_irq2: | |||
| 1792 | free_irq(IRQ_AMIGA_DSKBLK, NULL); | 1777 | free_irq(IRQ_AMIGA_DSKBLK, NULL); | 
| 1793 | out_irq: | 1778 | out_irq: | 
| 1794 | amiga_chip_free(raw_buf); | 1779 | amiga_chip_free(raw_buf); | 
| 1795 | out_memregion: | ||
| 1796 | release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | ||
| 1797 | out_blkdev: | 1780 | out_blkdev: | 
| 1798 | unregister_blkdev(FLOPPY_MAJOR,"fd"); | 1781 | unregister_blkdev(FLOPPY_MAJOR,"fd"); | 
| 1799 | return ret; | 1782 | return ret; | 
| 1800 | } | 1783 | } | 
| 1801 | 1784 | ||
| 1802 | module_init(amiga_floppy_init); | ||
| 1803 | #ifdef MODULE | ||
| 1804 | |||
| 1805 | #if 0 /* not safe to unload */ | 1785 | #if 0 /* not safe to unload */ | 
| 1806 | void cleanup_module(void) | 1786 | static int __exit amiga_floppy_remove(struct platform_device *pdev) | 
| 1807 | { | 1787 | { | 
| 1808 | int i; | 1788 | int i; | 
| 1809 | 1789 | ||
| @@ -1820,12 +1800,25 @@ void cleanup_module(void) | |||
| 1820 | custom.dmacon = DMAF_DISK; /* disable DMA */ | 1800 | custom.dmacon = DMAF_DISK; /* disable DMA */ | 
| 1821 | amiga_chip_free(raw_buf); | 1801 | amiga_chip_free(raw_buf); | 
| 1822 | blk_cleanup_queue(floppy_queue); | 1802 | blk_cleanup_queue(floppy_queue); | 
| 1823 | release_mem_region(CUSTOM_PHYSADDR+0x20, 8); | ||
| 1824 | unregister_blkdev(FLOPPY_MAJOR, "fd"); | 1803 | unregister_blkdev(FLOPPY_MAJOR, "fd"); | 
| 1825 | } | 1804 | } | 
| 1826 | #endif | 1805 | #endif | 
| 1827 | 1806 | ||
| 1828 | #else | 1807 | static struct platform_driver amiga_floppy_driver = { | 
| 1808 | .driver = { | ||
| 1809 | .name = "amiga-floppy", | ||
| 1810 | .owner = THIS_MODULE, | ||
| 1811 | }, | ||
| 1812 | }; | ||
| 1813 | |||
| 1814 | static int __init amiga_floppy_init(void) | ||
| 1815 | { | ||
| 1816 | return platform_driver_probe(&amiga_floppy_driver, amiga_floppy_probe); | ||
| 1817 | } | ||
| 1818 | |||
| 1819 | module_init(amiga_floppy_init); | ||
| 1820 | |||
| 1821 | #ifndef MODULE | ||
| 1829 | static int __init amiga_floppy_setup (char *str) | 1822 | static int __init amiga_floppy_setup (char *str) | 
| 1830 | { | 1823 | { | 
| 1831 | int n; | 1824 | int n; | 
| @@ -1840,3 +1833,5 @@ static int __init amiga_floppy_setup (char *str) | |||
| 1840 | 1833 | ||
| 1841 | __setup("floppy=", amiga_floppy_setup); | 1834 | __setup("floppy=", amiga_floppy_setup); | 
| 1842 | #endif | 1835 | #endif | 
| 1836 | |||
| 1837 | MODULE_ALIAS("platform:amiga-floppy"); | ||
| diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 8dfd24721a82..78a62ebe75c7 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c | |||
| @@ -627,7 +627,6 @@ static irqreturn_t cd2401_rx_interrupt(int irq, void *dev_id) | |||
| 627 | char data; | 627 | char data; | 
| 628 | int char_count; | 628 | int char_count; | 
| 629 | int save_cnt; | 629 | int save_cnt; | 
| 630 | int len; | ||
| 631 | 630 | ||
| 632 | /* determine the channel and change to that context */ | 631 | /* determine the channel and change to that context */ | 
| 633 | channel = (u_short) (base_addr[CyLICR] >> 2); | 632 | channel = (u_short) (base_addr[CyLICR] >> 2); | 
| @@ -1528,7 +1527,6 @@ static int | |||
| 1528 | cy_ioctl(struct tty_struct *tty, struct file *file, | 1527 | cy_ioctl(struct tty_struct *tty, struct file *file, | 
| 1529 | unsigned int cmd, unsigned long arg) | 1528 | unsigned int cmd, unsigned long arg) | 
| 1530 | { | 1529 | { | 
| 1531 | unsigned long val; | ||
| 1532 | struct cyclades_port *info = tty->driver_data; | 1530 | struct cyclades_port *info = tty->driver_data; | 
| 1533 | int ret_val = 0; | 1531 | int ret_val = 0; | 
| 1534 | void __user *argp = (void __user *)arg; | 1532 | void __user *argp = (void __user *)arg; | 
| diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index ed5e9742be2c..a8f0512bad38 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
| @@ -674,6 +674,7 @@ static struct zorro_device_id a2065_zorro_tbl[] __devinitdata = { | |||
| 674 | { ZORRO_PROD_AMERISTAR_A2065 }, | 674 | { ZORRO_PROD_AMERISTAR_A2065 }, | 
| 675 | { 0 } | 675 | { 0 } | 
| 676 | }; | 676 | }; | 
| 677 | MODULE_DEVICE_TABLE(zorro, a2065_zorro_tbl); | ||
| 677 | 678 | ||
| 678 | static struct zorro_driver a2065_driver = { | 679 | static struct zorro_driver a2065_driver = { | 
| 679 | .name = "a2065", | 680 | .name = "a2065", | 
| diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c index fa1a2354f5f9..4b30a46486e2 100644 --- a/drivers/net/ariadne.c +++ b/drivers/net/ariadne.c | |||
| @@ -145,6 +145,7 @@ static struct zorro_device_id ariadne_zorro_tbl[] __devinitdata = { | |||
| 145 | { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE }, | 145 | { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE }, | 
| 146 | { 0 } | 146 | { 0 } | 
| 147 | }; | 147 | }; | 
| 148 | MODULE_DEVICE_TABLE(zorro, ariadne_zorro_tbl); | ||
| 148 | 149 | ||
| 149 | static struct zorro_driver ariadne_driver = { | 150 | static struct zorro_driver ariadne_driver = { | 
| 150 | .name = "ariadne", | 151 | .name = "ariadne", | 
| diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c index 24724b4ad709..07d8e5b634f3 100644 --- a/drivers/net/hydra.c +++ b/drivers/net/hydra.c | |||
| @@ -71,6 +71,7 @@ static struct zorro_device_id hydra_zorro_tbl[] __devinitdata = { | |||
| 71 | { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET }, | 71 | { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET }, | 
| 72 | { 0 } | 72 | { 0 } | 
| 73 | }; | 73 | }; | 
| 74 | MODULE_DEVICE_TABLE(zorro, hydra_zorro_tbl); | ||
| 74 | 75 | ||
| 75 | static struct zorro_driver hydra_driver = { | 76 | static struct zorro_driver hydra_driver = { | 
| 76 | .name = "hydra", | 77 | .name = "hydra", | 
| diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c index 81c753a617ab..9548cbb5012a 100644 --- a/drivers/net/zorro8390.c +++ b/drivers/net/zorro8390.c | |||
| @@ -102,6 +102,7 @@ static struct zorro_device_id zorro8390_zorro_tbl[] __devinitdata = { | |||
| 102 | { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, }, | 102 | { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, }, | 
| 103 | { 0 } | 103 | { 0 } | 
| 104 | }; | 104 | }; | 
| 105 | MODULE_DEVICE_TABLE(zorro, zorro8390_zorro_tbl); | ||
| 105 | 106 | ||
| 106 | static struct zorro_driver zorro8390_driver = { | 107 | static struct zorro_driver zorro8390_driver = { | 
| 107 | .name = "zorro8390", | 108 | .name = "zorro8390", | 
| diff --git a/drivers/scsi/zorro7xx.c b/drivers/scsi/zorro7xx.c index 105449c15fa9..e17764d71476 100644 --- a/drivers/scsi/zorro7xx.c +++ b/drivers/scsi/zorro7xx.c | |||
| @@ -69,6 +69,7 @@ static struct zorro_device_id zorro7xx_zorro_tbl[] __devinitdata = { | |||
| 69 | }, | 69 | }, | 
| 70 | { 0 } | 70 | { 0 } | 
| 71 | }; | 71 | }; | 
| 72 | MODULE_DEVICE_TABLE(zorro, zorro7xx_zorro_tbl); | ||
| 72 | 73 | ||
| 73 | static int __devinit zorro7xx_init_one(struct zorro_dev *z, | 74 | static int __devinit zorro7xx_init_one(struct zorro_dev *z, | 
| 74 | const struct zorro_device_id *ent) | 75 | const struct zorro_device_id *ent) | 
| diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index dca48df98444..e5d6b56d4447 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c | |||
| @@ -50,8 +50,9 @@ | |||
| 50 | #include <linux/fb.h> | 50 | #include <linux/fb.h> | 
| 51 | #include <linux/init.h> | 51 | #include <linux/init.h> | 
| 52 | #include <linux/ioport.h> | 52 | #include <linux/ioport.h> | 
| 53 | 53 | #include <linux/platform_device.h> | |
| 54 | #include <linux/uaccess.h> | 54 | #include <linux/uaccess.h> | 
| 55 | |||
| 55 | #include <asm/system.h> | 56 | #include <asm/system.h> | 
| 56 | #include <asm/irq.h> | 57 | #include <asm/irq.h> | 
| 57 | #include <asm/amigahw.h> | 58 | #include <asm/amigahw.h> | 
| @@ -1135,7 +1136,7 @@ static int amifb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg | |||
| 1135 | * Interface to the low level console driver | 1136 | * Interface to the low level console driver | 
| 1136 | */ | 1137 | */ | 
| 1137 | 1138 | ||
| 1138 | static void amifb_deinit(void); | 1139 | static void amifb_deinit(struct platform_device *pdev); | 
| 1139 | 1140 | ||
| 1140 | /* | 1141 | /* | 
| 1141 | * Internal routines | 1142 | * Internal routines | 
| @@ -2246,7 +2247,7 @@ static inline void chipfree(void) | |||
| 2246 | * Initialisation | 2247 | * Initialisation | 
| 2247 | */ | 2248 | */ | 
| 2248 | 2249 | ||
| 2249 | static int __init amifb_init(void) | 2250 | static int __init amifb_probe(struct platform_device *pdev) | 
| 2250 | { | 2251 | { | 
| 2251 | int tag, i, err = 0; | 2252 | int tag, i, err = 0; | 
| 2252 | u_long chipptr; | 2253 | u_long chipptr; | 
| @@ -2261,16 +2262,6 @@ static int __init amifb_init(void) | |||
| 2261 | } | 2262 | } | 
| 2262 | amifb_setup(option); | 2263 | amifb_setup(option); | 
| 2263 | #endif | 2264 | #endif | 
| 2264 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_VIDEO)) | ||
| 2265 | return -ENODEV; | ||
| 2266 | |||
| 2267 | /* | ||
| 2268 | * We request all registers starting from bplpt[0] | ||
| 2269 | */ | ||
| 2270 | if (!request_mem_region(CUSTOM_PHYSADDR+0xe0, 0x120, | ||
| 2271 | "amifb [Denise/Lisa]")) | ||
| 2272 | return -EBUSY; | ||
| 2273 | |||
| 2274 | custom.dmacon = DMAF_ALL | DMAF_MASTER; | 2265 | custom.dmacon = DMAF_ALL | DMAF_MASTER; | 
| 2275 | 2266 | ||
| 2276 | switch (amiga_chipset) { | 2267 | switch (amiga_chipset) { | 
| @@ -2377,6 +2368,7 @@ default_chipset: | |||
| 2377 | fb_info.fbops = &amifb_ops; | 2368 | fb_info.fbops = &amifb_ops; | 
| 2378 | fb_info.par = ¤tpar; | 2369 | fb_info.par = ¤tpar; | 
| 2379 | fb_info.flags = FBINFO_DEFAULT; | 2370 | fb_info.flags = FBINFO_DEFAULT; | 
| 2371 | fb_info.device = &pdev->dev; | ||
| 2380 | 2372 | ||
| 2381 | if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, ami_modedb, | 2373 | if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, ami_modedb, | 
| 2382 | NUM_TOTAL_MODES, &ami_modedb[defmode], 4)) { | 2374 | NUM_TOTAL_MODES, &ami_modedb[defmode], 4)) { | 
| @@ -2451,18 +2443,18 @@ default_chipset: | |||
| 2451 | return 0; | 2443 | return 0; | 
| 2452 | 2444 | ||
| 2453 | amifb_error: | 2445 | amifb_error: | 
| 2454 | amifb_deinit(); | 2446 | amifb_deinit(pdev); | 
| 2455 | return err; | 2447 | return err; | 
| 2456 | } | 2448 | } | 
| 2457 | 2449 | ||
| 2458 | static void amifb_deinit(void) | 2450 | static void amifb_deinit(struct platform_device *pdev) | 
| 2459 | { | 2451 | { | 
| 2460 | if (fb_info.cmap.len) | 2452 | if (fb_info.cmap.len) | 
| 2461 | fb_dealloc_cmap(&fb_info.cmap); | 2453 | fb_dealloc_cmap(&fb_info.cmap); | 
| 2454 | fb_dealloc_cmap(&fb_info.cmap); | ||
| 2462 | chipfree(); | 2455 | chipfree(); | 
| 2463 | if (videomemory) | 2456 | if (videomemory) | 
| 2464 | iounmap((void*)videomemory); | 2457 | iounmap((void*)videomemory); | 
| 2465 | release_mem_region(CUSTOM_PHYSADDR+0xe0, 0x120); | ||
| 2466 | custom.dmacon = DMAF_ALL | DMAF_MASTER; | 2458 | custom.dmacon = DMAF_ALL | DMAF_MASTER; | 
| 2467 | } | 2459 | } | 
| 2468 | 2460 | ||
| @@ -3794,14 +3786,35 @@ static void ami_rebuild_copper(void) | |||
| 3794 | } | 3786 | } | 
| 3795 | } | 3787 | } | 
| 3796 | 3788 | ||
| 3797 | static void __exit amifb_exit(void) | 3789 | static int __exit amifb_remove(struct platform_device *pdev) | 
| 3798 | { | 3790 | { | 
| 3799 | unregister_framebuffer(&fb_info); | 3791 | unregister_framebuffer(&fb_info); | 
| 3800 | amifb_deinit(); | 3792 | amifb_deinit(pdev); | 
| 3801 | amifb_video_off(); | 3793 | amifb_video_off(); | 
| 3794 | return 0; | ||
| 3795 | } | ||
| 3796 | |||
| 3797 | static struct platform_driver amifb_driver = { | ||
| 3798 | .remove = __exit_p(amifb_remove), | ||
| 3799 | .driver = { | ||
| 3800 | .name = "amiga-video", | ||
| 3801 | .owner = THIS_MODULE, | ||
| 3802 | }, | ||
| 3803 | }; | ||
| 3804 | |||
| 3805 | static int __init amifb_init(void) | ||
| 3806 | { | ||
| 3807 | return platform_driver_probe(&amifb_driver, amifb_probe); | ||
| 3802 | } | 3808 | } | 
| 3803 | 3809 | ||
| 3804 | module_init(amifb_init); | 3810 | module_init(amifb_init); | 
| 3811 | |||
| 3812 | static void __exit amifb_exit(void) | ||
| 3813 | { | ||
| 3814 | platform_driver_unregister(&amifb_driver); | ||
| 3815 | } | ||
| 3816 | |||
| 3805 | module_exit(amifb_exit); | 3817 | module_exit(amifb_exit); | 
| 3806 | 3818 | ||
| 3807 | MODULE_LICENSE("GPL"); | 3819 | MODULE_LICENSE("GPL"); | 
| 3820 | MODULE_ALIAS("platform:amiga-video"); | ||
| diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 8d8dfda2f868..6df7c54db0a3 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
| @@ -299,6 +299,7 @@ static const struct zorro_device_id cirrusfb_zorro_table[] = { | |||
| 299 | }, | 299 | }, | 
| 300 | { 0 } | 300 | { 0 } | 
| 301 | }; | 301 | }; | 
| 302 | MODULE_DEVICE_TABLE(zorro, cirrusfb_zorro_table); | ||
| 302 | 303 | ||
| 303 | static const struct { | 304 | static const struct { | 
| 304 | zorro_id id2; | 305 | zorro_id id2; | 
| diff --git a/drivers/video/fm2fb.c b/drivers/video/fm2fb.c index 6c91c61cdb63..1b0feb8e7244 100644 --- a/drivers/video/fm2fb.c +++ b/drivers/video/fm2fb.c | |||
| @@ -219,6 +219,7 @@ static struct zorro_device_id fm2fb_devices[] __devinitdata = { | |||
| 219 | { ZORRO_PROD_HELFRICH_RAINBOW_II }, | 219 | { ZORRO_PROD_HELFRICH_RAINBOW_II }, | 
| 220 | { 0 } | 220 | { 0 } | 
| 221 | }; | 221 | }; | 
| 222 | MODULE_DEVICE_TABLE(zorro, fm2fb_devices); | ||
| 222 | 223 | ||
| 223 | static struct zorro_driver fm2fb_driver = { | 224 | static struct zorro_driver fm2fb_driver = { | 
| 224 | .name = "fm2fb", | 225 | .name = "fm2fb", | 
| diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c index d47c47fc048f..3c7046d79654 100644 --- a/drivers/zorro/proc.c +++ b/drivers/zorro/proc.c | |||
| @@ -97,7 +97,7 @@ static void zorro_seq_stop(struct seq_file *m, void *v) | |||
| 97 | 97 | ||
| 98 | static int zorro_seq_show(struct seq_file *m, void *v) | 98 | static int zorro_seq_show(struct seq_file *m, void *v) | 
| 99 | { | 99 | { | 
| 100 | u_int slot = *(loff_t *)v; | 100 | unsigned int slot = *(loff_t *)v; | 
| 101 | struct zorro_dev *z = &zorro_autocon[slot]; | 101 | struct zorro_dev *z = &zorro_autocon[slot]; | 
| 102 | 102 | ||
| 103 | seq_printf(m, "%02x\t%08x\t%08lx\t%08lx\t%02x\n", slot, z->id, | 103 | seq_printf(m, "%02x\t%08x\t%08lx\t%08lx\t%02x\n", slot, z->id, | 
| @@ -129,7 +129,7 @@ static const struct file_operations zorro_devices_proc_fops = { | |||
| 129 | 129 | ||
| 130 | static struct proc_dir_entry *proc_bus_zorro_dir; | 130 | static struct proc_dir_entry *proc_bus_zorro_dir; | 
| 131 | 131 | ||
| 132 | static int __init zorro_proc_attach_device(u_int slot) | 132 | static int __init zorro_proc_attach_device(unsigned int slot) | 
| 133 | { | 133 | { | 
| 134 | struct proc_dir_entry *entry; | 134 | struct proc_dir_entry *entry; | 
| 135 | char name[4]; | 135 | char name[4]; | 
| @@ -146,7 +146,7 @@ static int __init zorro_proc_attach_device(u_int slot) | |||
| 146 | 146 | ||
| 147 | static int __init zorro_proc_init(void) | 147 | static int __init zorro_proc_init(void) | 
| 148 | { | 148 | { | 
| 149 | u_int slot; | 149 | unsigned int slot; | 
| 150 | 150 | ||
| 151 | if (MACH_IS_AMIGA && AMIGAHW_PRESENT(ZORRO)) { | 151 | if (MACH_IS_AMIGA && AMIGAHW_PRESENT(ZORRO)) { | 
| 152 | proc_bus_zorro_dir = proc_mkdir("bus/zorro", NULL); | 152 | proc_bus_zorro_dir = proc_mkdir("bus/zorro", NULL); | 
| diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c index 53180a37cc9a..7ee2b6e71786 100644 --- a/drivers/zorro/zorro-driver.c +++ b/drivers/zorro/zorro-driver.c | |||
| @@ -137,10 +137,34 @@ static int zorro_bus_match(struct device *dev, struct device_driver *drv) | |||
| 137 | return 0; | 137 | return 0; | 
| 138 | } | 138 | } | 
| 139 | 139 | ||
| 140 | static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env) | ||
| 141 | { | ||
| 142 | #ifdef CONFIG_HOTPLUG | ||
| 143 | struct zorro_dev *z; | ||
| 144 | |||
| 145 | if (!dev) | ||
| 146 | return -ENODEV; | ||
| 147 | |||
| 148 | z = to_zorro_dev(dev); | ||
| 149 | if (!z) | ||
| 150 | return -ENODEV; | ||
| 151 | |||
| 152 | if (add_uevent_var(env, "ZORRO_ID=%08X", z->id) || | ||
| 153 | add_uevent_var(env, "ZORRO_SLOT_NAME=%s", dev_name(dev)) || | ||
| 154 | add_uevent_var(env, "ZORRO_SLOT_ADDR=%04X", z->slotaddr) || | ||
| 155 | add_uevent_var(env, "MODALIAS=" ZORRO_DEVICE_MODALIAS_FMT, z->id)) | ||
| 156 | return -ENOMEM; | ||
| 157 | |||
| 158 | return 0; | ||
| 159 | #else /* !CONFIG_HOTPLUG */ | ||
| 160 | return -ENODEV; | ||
| 161 | #endif /* !CONFIG_HOTPLUG */ | ||
| 162 | } | ||
| 140 | 163 | ||
| 141 | struct bus_type zorro_bus_type = { | 164 | struct bus_type zorro_bus_type = { | 
| 142 | .name = "zorro", | 165 | .name = "zorro", | 
| 143 | .match = zorro_bus_match, | 166 | .match = zorro_bus_match, | 
| 167 | .uevent = zorro_uevent, | ||
| 144 | .probe = zorro_device_probe, | 168 | .probe = zorro_device_probe, | 
| 145 | .remove = zorro_device_remove, | 169 | .remove = zorro_device_remove, | 
| 146 | }; | 170 | }; | 
| diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 1d2a772ea14c..eb924e0a64ce 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c | |||
| @@ -77,6 +77,16 @@ static struct bin_attribute zorro_config_attr = { | |||
| 77 | .read = zorro_read_config, | 77 | .read = zorro_read_config, | 
| 78 | }; | 78 | }; | 
| 79 | 79 | ||
| 80 | static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | ||
| 81 | char *buf) | ||
| 82 | { | ||
| 83 | struct zorro_dev *z = to_zorro_dev(dev); | ||
| 84 | |||
| 85 | return sprintf(buf, ZORRO_DEVICE_MODALIAS_FMT "\n", z->id); | ||
| 86 | } | ||
| 87 | |||
| 88 | static DEVICE_ATTR(modalias, S_IRUGO, modalias_show, NULL); | ||
| 89 | |||
| 80 | int zorro_create_sysfs_dev_files(struct zorro_dev *z) | 90 | int zorro_create_sysfs_dev_files(struct zorro_dev *z) | 
| 81 | { | 91 | { | 
| 82 | struct device *dev = &z->dev; | 92 | struct device *dev = &z->dev; | 
| @@ -89,6 +99,7 @@ int zorro_create_sysfs_dev_files(struct zorro_dev *z) | |||
| 89 | (error = device_create_file(dev, &dev_attr_slotaddr)) || | 99 | (error = device_create_file(dev, &dev_attr_slotaddr)) || | 
| 90 | (error = device_create_file(dev, &dev_attr_slotsize)) || | 100 | (error = device_create_file(dev, &dev_attr_slotsize)) || | 
| 91 | (error = device_create_file(dev, &dev_attr_resource)) || | 101 | (error = device_create_file(dev, &dev_attr_resource)) || | 
| 102 | (error = device_create_file(dev, &dev_attr_modalias)) || | ||
| 92 | (error = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr))) | 103 | (error = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr))) | 
| 93 | return error; | 104 | return error; | 
| 94 | 105 | ||
| diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c index d45fb34e2d23..6455f3a244c5 100644 --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c | |||
| @@ -15,6 +15,8 @@ | |||
| 15 | #include <linux/zorro.h> | 15 | #include <linux/zorro.h> | 
| 16 | #include <linux/bitops.h> | 16 | #include <linux/bitops.h> | 
| 17 | #include <linux/string.h> | 17 | #include <linux/string.h> | 
| 18 | #include <linux/platform_device.h> | ||
| 19 | #include <linux/slab.h> | ||
| 18 | 20 | ||
| 19 | #include <asm/setup.h> | 21 | #include <asm/setup.h> | 
| 20 | #include <asm/amigahw.h> | 22 | #include <asm/amigahw.h> | 
| @@ -26,24 +28,17 @@ | |||
| 26 | * Zorro Expansion Devices | 28 | * Zorro Expansion Devices | 
| 27 | */ | 29 | */ | 
| 28 | 30 | ||
| 29 | u_int zorro_num_autocon = 0; | 31 | unsigned int zorro_num_autocon; | 
| 30 | struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; | 32 | struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; | 
| 31 | 33 | ||
| 32 | 34 | ||
| 33 | /* | 35 | /* | 
| 34 | * Single Zorro bus | 36 | * Zorro bus | 
| 35 | */ | 37 | */ | 
| 36 | 38 | ||
| 37 | struct zorro_bus zorro_bus = {\ | 39 | struct zorro_bus { | 
| 38 | .resources = { | 40 | struct list_head devices; /* list of devices on this bus */ | 
| 39 | /* Zorro II regions (on Zorro II/III) */ | 41 | struct device dev; | 
| 40 | { .name = "Zorro II exp", .start = 0x00e80000, .end = 0x00efffff }, | ||
| 41 | { .name = "Zorro II mem", .start = 0x00200000, .end = 0x009fffff }, | ||
| 42 | /* Zorro III regions (on Zorro III only) */ | ||
| 43 | { .name = "Zorro III exp", .start = 0xff000000, .end = 0xffffffff }, | ||
| 44 | { .name = "Zorro III cfg", .start = 0x40000000, .end = 0x7fffffff } | ||
| 45 | }, | ||
| 46 | .name = "Zorro bus" | ||
| 47 | }; | 42 | }; | 
| 48 | 43 | ||
| 49 | 44 | ||
| @@ -53,18 +48,19 @@ struct zorro_bus zorro_bus = {\ | |||
| 53 | 48 | ||
| 54 | struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from) | 49 | struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from) | 
| 55 | { | 50 | { | 
| 56 | struct zorro_dev *z; | 51 | struct zorro_dev *z; | 
| 57 | 52 | ||
| 58 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) | 53 | if (!zorro_num_autocon) | 
| 59 | return NULL; | 54 | return NULL; | 
| 60 | 55 | ||
| 61 | for (z = from ? from+1 : &zorro_autocon[0]; | 56 | for (z = from ? from+1 : &zorro_autocon[0]; | 
| 62 | z < zorro_autocon+zorro_num_autocon; | 57 | z < zorro_autocon+zorro_num_autocon; | 
| 63 | z++) | 58 | z++) | 
| 64 | if (id == ZORRO_WILDCARD || id == z->id) | 59 | if (id == ZORRO_WILDCARD || id == z->id) | 
| 65 | return z; | 60 | return z; | 
| 66 | return NULL; | 61 | return NULL; | 
| 67 | } | 62 | } | 
| 63 | EXPORT_SYMBOL(zorro_find_device); | ||
| 68 | 64 | ||
| 69 | 65 | ||
| 70 | /* | 66 | /* | 
| @@ -83,121 +79,138 @@ struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from) | |||
| 83 | */ | 79 | */ | 
| 84 | 80 | ||
| 85 | DECLARE_BITMAP(zorro_unused_z2ram, 128); | 81 | DECLARE_BITMAP(zorro_unused_z2ram, 128); | 
| 82 | EXPORT_SYMBOL(zorro_unused_z2ram); | ||
| 86 | 83 | ||
| 87 | 84 | ||
| 88 | static void __init mark_region(unsigned long start, unsigned long end, | 85 | static void __init mark_region(unsigned long start, unsigned long end, | 
| 89 | int flag) | 86 | int flag) | 
| 90 | { | 87 | { | 
| 91 | if (flag) | ||
| 92 | start += Z2RAM_CHUNKMASK; | ||
| 93 | else | ||
| 94 | end += Z2RAM_CHUNKMASK; | ||
| 95 | start &= ~Z2RAM_CHUNKMASK; | ||
| 96 | end &= ~Z2RAM_CHUNKMASK; | ||
| 97 | |||
| 98 | if (end <= Z2RAM_START || start >= Z2RAM_END) | ||
| 99 | return; | ||
| 100 | start = start < Z2RAM_START ? 0x00000000 : start-Z2RAM_START; | ||
| 101 | end = end > Z2RAM_END ? Z2RAM_SIZE : end-Z2RAM_START; | ||
| 102 | while (start < end) { | ||
| 103 | u32 chunk = start>>Z2RAM_CHUNKSHIFT; | ||
| 104 | if (flag) | 88 | if (flag) | 
| 105 | set_bit(chunk, zorro_unused_z2ram); | 89 | start += Z2RAM_CHUNKMASK; | 
| 106 | else | 90 | else | 
| 107 | clear_bit(chunk, zorro_unused_z2ram); | 91 | end += Z2RAM_CHUNKMASK; | 
| 108 | start += Z2RAM_CHUNKSIZE; | 92 | start &= ~Z2RAM_CHUNKMASK; | 
| 109 | } | 93 | end &= ~Z2RAM_CHUNKMASK; | 
| 94 | |||
| 95 | if (end <= Z2RAM_START || start >= Z2RAM_END) | ||
| 96 | return; | ||
| 97 | start = start < Z2RAM_START ? 0x00000000 : start-Z2RAM_START; | ||
| 98 | end = end > Z2RAM_END ? Z2RAM_SIZE : end-Z2RAM_START; | ||
| 99 | while (start < end) { | ||
| 100 | u32 chunk = start>>Z2RAM_CHUNKSHIFT; | ||
| 101 | if (flag) | ||
| 102 | set_bit(chunk, zorro_unused_z2ram); | ||
| 103 | else | ||
| 104 | clear_bit(chunk, zorro_unused_z2ram); | ||
| 105 | start += Z2RAM_CHUNKSIZE; | ||
| 106 | } | ||
| 110 | } | 107 | } | 
| 111 | 108 | ||
| 112 | 109 | ||
| 113 | static struct resource __init *zorro_find_parent_resource(struct zorro_dev *z) | 110 | static struct resource __init *zorro_find_parent_resource( | 
| 111 | struct platform_device *bridge, struct zorro_dev *z) | ||
| 114 | { | 112 | { | 
| 115 | int i; | 113 | int i; | 
| 116 | 114 | ||
| 117 | for (i = 0; i < zorro_bus.num_resources; i++) | 115 | for (i = 0; i < bridge->num_resources; i++) { | 
| 118 | if (zorro_resource_start(z) >= zorro_bus.resources[i].start && | 116 | struct resource *r = &bridge->resource[i]; | 
| 119 | zorro_resource_end(z) <= zorro_bus.resources[i].end) | 117 | if (zorro_resource_start(z) >= r->start && | 
| 120 | return &zorro_bus.resources[i]; | 118 | zorro_resource_end(z) <= r->end) | 
| 121 | return &iomem_resource; | 119 | return r; | 
| 120 | } | ||
| 121 | return &iomem_resource; | ||
| 122 | } | 122 | } | 
| 123 | 123 | ||
| 124 | 124 | ||
| 125 | /* | ||
| 126 | * Initialization | ||
| 127 | */ | ||
| 128 | 125 | ||
| 129 | static int __init zorro_init(void) | 126 | static int __init amiga_zorro_probe(struct platform_device *pdev) | 
| 130 | { | 127 | { | 
| 131 | struct zorro_dev *z; | 128 | struct zorro_bus *bus; | 
| 132 | unsigned int i; | 129 | struct zorro_dev *z; | 
| 133 | int error; | 130 | struct resource *r; | 
| 134 | 131 | unsigned int i; | |
| 135 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) | 132 | int error; | 
| 136 | return 0; | 133 | |
| 137 | 134 | /* Initialize the Zorro bus */ | |
| 138 | pr_info("Zorro: Probing AutoConfig expansion devices: %d device%s\n", | 135 | bus = kzalloc(sizeof(*bus), GFP_KERNEL); | 
| 139 | zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s"); | 136 | if (!bus) | 
| 140 | 137 | return -ENOMEM; | |
| 141 | /* Initialize the Zorro bus */ | 138 | |
| 142 | INIT_LIST_HEAD(&zorro_bus.devices); | 139 | INIT_LIST_HEAD(&bus->devices); | 
| 143 | dev_set_name(&zorro_bus.dev, "zorro"); | 140 | bus->dev.parent = &pdev->dev; | 
| 144 | error = device_register(&zorro_bus.dev); | 141 | dev_set_name(&bus->dev, "zorro"); | 
| 145 | if (error) { | 142 | error = device_register(&bus->dev); | 
| 146 | pr_err("Zorro: Error registering zorro_bus\n"); | ||
| 147 | return error; | ||
| 148 | } | ||
| 149 | |||
| 150 | /* Request the resources */ | ||
| 151 | zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; | ||
| 152 | for (i = 0; i < zorro_bus.num_resources; i++) | ||
| 153 | request_resource(&iomem_resource, &zorro_bus.resources[i]); | ||
| 154 | |||
| 155 | /* Register all devices */ | ||
| 156 | for (i = 0; i < zorro_num_autocon; i++) { | ||
| 157 | z = &zorro_autocon[i]; | ||
| 158 | z->id = (z->rom.er_Manufacturer<<16) | (z->rom.er_Product<<8); | ||
| 159 | if (z->id == ZORRO_PROD_GVP_EPC_BASE) { | ||
| 160 | /* GVP quirk */ | ||
| 161 | unsigned long magic = zorro_resource_start(z)+0x8000; | ||
| 162 | z->id |= *(u16 *)ZTWO_VADDR(magic) & GVP_PRODMASK; | ||
| 163 | } | ||
| 164 | sprintf(z->name, "Zorro device %08x", z->id); | ||
| 165 | zorro_name_device(z); | ||
| 166 | z->resource.name = z->name; | ||
| 167 | if (request_resource(zorro_find_parent_resource(z), &z->resource)) | ||
| 168 | pr_err("Zorro: Address space collision on device %s %pR\n", | ||
| 169 | z->name, &z->resource); | ||
| 170 | dev_set_name(&z->dev, "%02x", i); | ||
| 171 | z->dev.parent = &zorro_bus.dev; | ||
| 172 | z->dev.bus = &zorro_bus_type; | ||
| 173 | error = device_register(&z->dev); | ||
| 174 | if (error) { | 143 | if (error) { | 
| 175 | pr_err("Zorro: Error registering device %s\n", z->name); | 144 | pr_err("Zorro: Error registering zorro_bus\n"); | 
| 176 | continue; | 145 | kfree(bus); | 
| 146 | return error; | ||
| 177 | } | 147 | } | 
| 178 | error = zorro_create_sysfs_dev_files(z); | 148 | platform_set_drvdata(pdev, bus); | 
| 179 | if (error) | 149 | |
| 180 | dev_err(&z->dev, "Error creating sysfs files\n"); | 150 | /* Register all devices */ | 
| 181 | } | 151 | pr_info("Zorro: Probing AutoConfig expansion devices: %u device%s\n", | 
| 182 | 152 | zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s"); | |
| 183 | /* Mark all available Zorro II memory */ | 153 | |
| 184 | zorro_for_each_dev(z) { | 154 | for (i = 0; i < zorro_num_autocon; i++) { | 
| 185 | if (z->rom.er_Type & ERTF_MEMLIST) | 155 | z = &zorro_autocon[i]; | 
| 186 | mark_region(zorro_resource_start(z), zorro_resource_end(z)+1, 1); | 156 | z->id = (z->rom.er_Manufacturer<<16) | (z->rom.er_Product<<8); | 
| 187 | } | 157 | if (z->id == ZORRO_PROD_GVP_EPC_BASE) { | 
| 188 | 158 | /* GVP quirk */ | |
| 189 | /* Unmark all used Zorro II memory */ | 159 | unsigned long magic = zorro_resource_start(z)+0x8000; | 
| 190 | for (i = 0; i < m68k_num_memory; i++) | 160 | z->id |= *(u16 *)ZTWO_VADDR(magic) & GVP_PRODMASK; | 
| 191 | if (m68k_memory[i].addr < 16*1024*1024) | 161 | } | 
| 192 | mark_region(m68k_memory[i].addr, | 162 | sprintf(z->name, "Zorro device %08x", z->id); | 
| 193 | m68k_memory[i].addr+m68k_memory[i].size, 0); | 163 | zorro_name_device(z); | 
| 194 | 164 | z->resource.name = z->name; | |
| 195 | return 0; | 165 | r = zorro_find_parent_resource(pdev, z); | 
| 166 | error = request_resource(r, &z->resource); | ||
| 167 | if (error) | ||
| 168 | dev_err(&bus->dev, | ||
| 169 | "Address space collision on device %s %pR\n", | ||
| 170 | z->name, &z->resource); | ||
| 171 | dev_set_name(&z->dev, "%02x", i); | ||
| 172 | z->dev.parent = &bus->dev; | ||
| 173 | z->dev.bus = &zorro_bus_type; | ||
| 174 | error = device_register(&z->dev); | ||
| 175 | if (error) { | ||
| 176 | dev_err(&bus->dev, "Error registering device %s\n", | ||
| 177 | z->name); | ||
| 178 | continue; | ||
| 179 | } | ||
| 180 | error = zorro_create_sysfs_dev_files(z); | ||
| 181 | if (error) | ||
| 182 | dev_err(&z->dev, "Error creating sysfs files\n"); | ||
| 183 | } | ||
| 184 | |||
| 185 | /* Mark all available Zorro II memory */ | ||
| 186 | zorro_for_each_dev(z) { | ||
| 187 | if (z->rom.er_Type & ERTF_MEMLIST) | ||
| 188 | mark_region(zorro_resource_start(z), | ||
| 189 | zorro_resource_end(z)+1, 1); | ||
| 190 | } | ||
| 191 | |||
| 192 | /* Unmark all used Zorro II memory */ | ||
| 193 | for (i = 0; i < m68k_num_memory; i++) | ||
| 194 | if (m68k_memory[i].addr < 16*1024*1024) | ||
| 195 | mark_region(m68k_memory[i].addr, | ||
| 196 | m68k_memory[i].addr+m68k_memory[i].size, | ||
| 197 | 0); | ||
| 198 | |||
| 199 | return 0; | ||
| 196 | } | 200 | } | 
| 197 | 201 | ||
| 198 | subsys_initcall(zorro_init); | 202 | static struct platform_driver amiga_zorro_driver = { | 
| 203 | .driver = { | ||
| 204 | .name = "amiga-zorro", | ||
| 205 | .owner = THIS_MODULE, | ||
| 206 | }, | ||
| 207 | }; | ||
| 199 | 208 | ||
| 200 | EXPORT_SYMBOL(zorro_find_device); | 209 | static int __init amiga_zorro_init(void) | 
| 201 | EXPORT_SYMBOL(zorro_unused_z2ram); | 210 | { | 
| 211 | return platform_driver_probe(&amiga_zorro_driver, amiga_zorro_probe); | ||
| 212 | } | ||
| 213 | |||
| 214 | module_init(amiga_zorro_init); | ||
| 202 | 215 | ||
| 203 | MODULE_LICENSE("GPL"); | 216 | MODULE_LICENSE("GPL"); | 
| diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index f58e9d836f32..56fde4364e4c 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -474,4 +474,13 @@ struct platform_device_id { | |||
| 474 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 474 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 
| 475 | }; | 475 | }; | 
| 476 | 476 | ||
| 477 | struct zorro_device_id { | ||
| 478 | __u32 id; /* Device ID or ZORRO_WILDCARD */ | ||
| 479 | kernel_ulong_t driver_data; /* Data private to the driver */ | ||
| 480 | }; | ||
| 481 | |||
| 482 | #define ZORRO_WILDCARD (0xffffffff) /* not official */ | ||
| 483 | |||
| 484 | #define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X" | ||
| 485 | |||
| 477 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 486 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 
| diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 212da17d06af..5417944d3687 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -44,12 +44,14 @@ extern int platform_get_irq_byname(struct platform_device *, const char *); | |||
| 44 | extern int platform_add_devices(struct platform_device **, int); | 44 | extern int platform_add_devices(struct platform_device **, int); | 
| 45 | 45 | ||
| 46 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 46 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 
| 47 | struct resource *, unsigned int); | 47 | const struct resource *, unsigned int); | 
| 48 | extern struct platform_device *platform_device_register_data(struct device *, | 48 | extern struct platform_device *platform_device_register_data(struct device *, | 
| 49 | const char *, int, const void *, size_t); | 49 | const char *, int, const void *, size_t); | 
| 50 | 50 | ||
| 51 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 51 | extern struct platform_device *platform_device_alloc(const char *name, int id); | 
| 52 | extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); | 52 | extern int platform_device_add_resources(struct platform_device *pdev, | 
| 53 | const struct resource *res, | ||
| 54 | unsigned int num); | ||
| 53 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); | 55 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); | 
| 54 | extern int platform_device_add(struct platform_device *pdev); | 56 | extern int platform_device_add(struct platform_device *pdev); | 
| 55 | extern void platform_device_del(struct platform_device *pdev); | 57 | extern void platform_device_del(struct platform_device *pdev); | 
| diff --git a/include/linux/zorro.h b/include/linux/zorro.h index 913bfc226dda..7bf9db525e9e 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
| @@ -38,8 +38,6 @@ | |||
| 38 | typedef __u32 zorro_id; | 38 | typedef __u32 zorro_id; | 
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | #define ZORRO_WILDCARD (0xffffffff) /* not official */ | ||
| 42 | |||
| 43 | /* Include the ID list */ | 41 | /* Include the ID list */ | 
| 44 | #include <linux/zorro_ids.h> | 42 | #include <linux/zorro_ids.h> | 
| 45 | 43 | ||
| @@ -116,6 +114,7 @@ struct ConfigDev { | |||
| 116 | 114 | ||
| 117 | #include <linux/init.h> | 115 | #include <linux/init.h> | 
| 118 | #include <linux/ioport.h> | 116 | #include <linux/ioport.h> | 
| 117 | #include <linux/mod_devicetable.h> | ||
| 119 | 118 | ||
| 120 | #include <asm/zorro.h> | 119 | #include <asm/zorro.h> | 
| 121 | 120 | ||
| @@ -142,29 +141,10 @@ struct zorro_dev { | |||
| 142 | * Zorro bus | 141 | * Zorro bus | 
| 143 | */ | 142 | */ | 
| 144 | 143 | ||
| 145 | struct zorro_bus { | ||
| 146 | struct list_head devices; /* list of devices on this bus */ | ||
| 147 | unsigned int num_resources; /* number of resources */ | ||
| 148 | struct resource resources[4]; /* address space routed to this bus */ | ||
| 149 | struct device dev; | ||
| 150 | char name[10]; | ||
| 151 | }; | ||
| 152 | |||
| 153 | extern struct zorro_bus zorro_bus; /* single Zorro bus */ | ||
| 154 | extern struct bus_type zorro_bus_type; | 144 | extern struct bus_type zorro_bus_type; | 
| 155 | 145 | ||
| 156 | 146 | ||
| 157 | /* | 147 | /* | 
| 158 | * Zorro device IDs | ||
| 159 | */ | ||
| 160 | |||
| 161 | struct zorro_device_id { | ||
| 162 | zorro_id id; /* Device ID or ZORRO_WILDCARD */ | ||
| 163 | unsigned long driver_data; /* Data private to the driver */ | ||
| 164 | }; | ||
| 165 | |||
| 166 | |||
| 167 | /* | ||
| 168 | * Zorro device drivers | 148 | * Zorro device drivers | 
| 169 | */ | 149 | */ | 
| 170 | 150 | ||
| diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 220213e603db..df90f31d14bf 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -796,6 +796,16 @@ static int do_platform_entry(const char *filename, | |||
| 796 | return 1; | 796 | return 1; | 
| 797 | } | 797 | } | 
| 798 | 798 | ||
| 799 | /* Looks like: zorro:iN. */ | ||
| 800 | static int do_zorro_entry(const char *filename, struct zorro_device_id *id, | ||
| 801 | char *alias) | ||
| 802 | { | ||
| 803 | id->id = TO_NATIVE(id->id); | ||
| 804 | strcpy(alias, "zorro:"); | ||
| 805 | ADD(alias, "i", id->id != ZORRO_WILDCARD, id->id); | ||
| 806 | return 1; | ||
| 807 | } | ||
| 808 | |||
| 799 | /* Ignore any prefix, eg. some architectures prepend _ */ | 809 | /* Ignore any prefix, eg. some architectures prepend _ */ | 
| 800 | static inline int sym_is(const char *symbol, const char *name) | 810 | static inline int sym_is(const char *symbol, const char *name) | 
| 801 | { | 811 | { | 
| @@ -943,6 +953,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
| 943 | do_table(symval, sym->st_size, | 953 | do_table(symval, sym->st_size, | 
| 944 | sizeof(struct platform_device_id), "platform", | 954 | sizeof(struct platform_device_id), "platform", | 
| 945 | do_platform_entry, mod); | 955 | do_platform_entry, mod); | 
| 956 | else if (sym_is(symname, "__mod_zorro_device_table")) | ||
| 957 | do_table(symval, sym->st_size, | ||
| 958 | sizeof(struct zorro_device_id), "zorro", | ||
| 959 | do_zorro_entry, mod); | ||
| 946 | free(zeros); | 960 | free(zeros); | 
| 947 | } | 961 | } | 
| 948 | 962 | ||
| diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c index bb14e4c67e89..87910e992133 100644 --- a/sound/oss/dmasound/dmasound_paula.c +++ b/sound/oss/dmasound/dmasound_paula.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/ioport.h> | 21 | #include <linux/ioport.h> | 
| 22 | #include <linux/soundcard.h> | 22 | #include <linux/soundcard.h> | 
| 23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> | 
| 24 | #include <linux/platform_device.h> | ||
| 24 | 25 | ||
| 25 | #include <asm/uaccess.h> | 26 | #include <asm/uaccess.h> | 
| 26 | #include <asm/setup.h> | 27 | #include <asm/setup.h> | 
| @@ -710,31 +711,41 @@ static MACHINE machAmiga = { | |||
| 710 | /*** Config & Setup **********************************************************/ | 711 | /*** Config & Setup **********************************************************/ | 
| 711 | 712 | ||
| 712 | 713 | ||
| 713 | static int __init dmasound_paula_init(void) | 714 | static int __init amiga_audio_probe(struct platform_device *pdev) | 
| 714 | { | 715 | { | 
| 715 | int err; | 716 | dmasound.mach = machAmiga; | 
| 716 | 717 | dmasound.mach.default_hard = def_hard ; | |
| 717 | if (MACH_IS_AMIGA && AMIGAHW_PRESENT(AMI_AUDIO)) { | 718 | dmasound.mach.default_soft = def_soft ; | 
| 718 | if (!request_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40, | 719 | return dmasound_init(); | 
| 719 | "dmasound [Paula]")) | ||
| 720 | return -EBUSY; | ||
| 721 | dmasound.mach = machAmiga; | ||
| 722 | dmasound.mach.default_hard = def_hard ; | ||
| 723 | dmasound.mach.default_soft = def_soft ; | ||
| 724 | err = dmasound_init(); | ||
| 725 | if (err) | ||
| 726 | release_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40); | ||
| 727 | return err; | ||
| 728 | } else | ||
| 729 | return -ENODEV; | ||
| 730 | } | 720 | } | 
| 731 | 721 | ||
| 732 | static void __exit dmasound_paula_cleanup(void) | 722 | static int __exit amiga_audio_remove(struct platform_device *pdev) | 
| 733 | { | 723 | { | 
| 734 | dmasound_deinit(); | 724 | dmasound_deinit(); | 
| 735 | release_mem_region(CUSTOM_PHYSADDR+0xa0, 0x40); | 725 | return 0; | 
| 726 | } | ||
| 727 | |||
| 728 | static struct platform_driver amiga_audio_driver = { | ||
| 729 | .remove = __exit_p(amiga_audio_remove), | ||
| 730 | .driver = { | ||
| 731 | .name = "amiga-audio", | ||
| 732 | .owner = THIS_MODULE, | ||
| 733 | }, | ||
| 734 | }; | ||
| 735 | |||
| 736 | static int __init amiga_audio_init(void) | ||
| 737 | { | ||
| 738 | return platform_driver_probe(&amiga_audio_driver, amiga_audio_probe); | ||
| 736 | } | 739 | } | 
| 737 | 740 | ||
| 738 | module_init(dmasound_paula_init); | 741 | module_init(amiga_audio_init); | 
| 739 | module_exit(dmasound_paula_cleanup); | 742 | |
| 743 | static void __exit amiga_audio_exit(void) | ||
| 744 | { | ||
| 745 | platform_driver_unregister(&amiga_audio_driver); | ||
| 746 | } | ||
| 747 | |||
| 748 | module_exit(amiga_audio_exit); | ||
| 749 | |||
| 740 | MODULE_LICENSE("GPL"); | 750 | MODULE_LICENSE("GPL"); | 
| 751 | MODULE_ALIAS("platform:amiga-audio"); | ||
