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 | } | ||
