diff options
author | Anton Altaparmakov <aia21@hera.kernel.org> | 2006-03-23 09:39:08 -0500 |
---|---|---|
committer | Anton Altaparmakov <aia21@hera.kernel.org> | 2006-03-23 09:39:08 -0500 |
commit | 74293759002aa7db0179158c20676a034614577b (patch) | |
tree | 030ef62361042d1a034087ad9a726db3b57bba72 /drivers/char | |
parent | bb8047d3540affd6b8c2adac3fe792e07143be0f (diff) | |
parent | 2e6e33bab6e1996a5dec9108fb467b52b841e7a8 (diff) |
Merge branch 'master' of /home/aia21/ntfs-2.6/
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 2 | ||||
-rw-r--r-- | drivers/char/Makefile | 2 | ||||
-rw-r--r-- | drivers/char/drm/Kconfig | 4 | ||||
-rw-r--r-- | drivers/char/drm/drm_vm.c | 1 | ||||
-rw-r--r-- | drivers/char/hvcs.c | 9 | ||||
-rw-r--r-- | drivers/char/hw_random.c | 2 | ||||
-rw-r--r-- | drivers/char/ip2/Makefile | 8 | ||||
-rw-r--r-- | drivers/char/ip2/ip2base.c (renamed from drivers/char/ip2.c) | 6 | ||||
-rw-r--r-- | drivers/char/ip2/ip2main.c (renamed from drivers/char/ip2main.c) | 20 | ||||
-rw-r--r-- | drivers/char/mmtimer.c | 2 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 24 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 23 | ||||
-rw-r--r-- | drivers/char/s3c2410-rtc.c | 4 | ||||
-rw-r--r-- | drivers/char/snsc.h | 5 | ||||
-rw-r--r-- | drivers/char/snsc_event.c | 32 | ||||
-rw-r--r-- | drivers/char/sx.c | 22 | ||||
-rw-r--r-- | drivers/char/synclink_gt.c | 2 | ||||
-rw-r--r-- | drivers/char/tb0219.c | 24 | ||||
-rw-r--r-- | drivers/char/tty_io.c | 2 | ||||
-rw-r--r-- | drivers/char/vr41xx_giu.c | 19 | ||||
-rw-r--r-- | drivers/char/vr41xx_rtc.c | 30 | ||||
-rw-r--r-- | drivers/char/watchdog/mpcore_wdt.c | 4 | ||||
-rw-r--r-- | drivers/char/watchdog/mv64x60_wdt.c | 20 |
23 files changed, 187 insertions, 80 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 05ba410682a3..b524f5ba78a9 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -695,7 +695,7 @@ config NVRAM | |||
695 | 695 | ||
696 | config RTC | 696 | config RTC |
697 | tristate "Enhanced Real Time Clock Support" | 697 | tristate "Enhanced Real Time Clock Support" |
698 | depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV | 698 | depends on !PPC && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV |
699 | ---help--- | 699 | ---help--- |
700 | If you say Y here and create a character special file /dev/rtc with | 700 | If you say Y here and create a character special file /dev/rtc with |
701 | major number 10 and minor number 135 using mknod ("man mknod"), you | 701 | major number 10 and minor number 135 using mknod ("man mknod"), you |
diff --git a/drivers/char/Makefile b/drivers/char/Makefile index 503dd901d406..090d154098bb 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile | |||
@@ -31,7 +31,7 @@ obj-$(CONFIG_MOXA_INTELLIO) += moxa.o | |||
31 | obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o | 31 | obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o |
32 | obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o | 32 | obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o |
33 | obj-$(CONFIG_MOXA_SMARTIO) += mxser.o | 33 | obj-$(CONFIG_MOXA_SMARTIO) += mxser.o |
34 | obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o | 34 | obj-$(CONFIG_COMPUTONE) += ip2/ |
35 | obj-$(CONFIG_RISCOM8) += riscom8.o | 35 | obj-$(CONFIG_RISCOM8) += riscom8.o |
36 | obj-$(CONFIG_ISI) += isicom.o | 36 | obj-$(CONFIG_ISI) += isicom.o |
37 | obj-$(CONFIG_SYNCLINK) += synclink.o | 37 | obj-$(CONFIG_SYNCLINK) += synclink.o |
diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig index 56ace9d5e2ae..5278c388d3e7 100644 --- a/drivers/char/drm/Kconfig +++ b/drivers/char/drm/Kconfig | |||
@@ -37,8 +37,8 @@ config DRM_RADEON | |||
37 | help | 37 | help |
38 | Choose this option if you have an ATI Radeon graphics card. There | 38 | Choose this option if you have an ATI Radeon graphics card. There |
39 | are both PCI and AGP versions. You don't need to choose this to | 39 | are both PCI and AGP versions. You don't need to choose this to |
40 | run the Radeon in plain VGA mode. There is a product page at | 40 | run the Radeon in plain VGA mode. |
41 | <http://www.ati.com/na/pages/products/pc/radeon32/index.html>. | 41 | |
42 | If M is selected, the module will be called radeon. | 42 | If M is selected, the module will be called radeon. |
43 | 43 | ||
44 | config DRM_I810 | 44 | config DRM_I810 |
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index 0291cd62c69f..ffd0800ed601 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c | |||
@@ -619,6 +619,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma) | |||
619 | #endif | 619 | #endif |
620 | offset = dev->driver->get_reg_ofs(dev); | 620 | offset = dev->driver->get_reg_ofs(dev); |
621 | #ifdef __sparc__ | 621 | #ifdef __sparc__ |
622 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
622 | if (io_remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start, | 623 | if (io_remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start, |
623 | (map->offset + offset) >> PAGE_SHIFT, | 624 | (map->offset + offset) >> PAGE_SHIFT, |
624 | vma->vm_end - vma->vm_start, | 625 | vma->vm_end - vma->vm_start, |
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index 831eb4e8d9d3..f7ac31856572 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c | |||
@@ -118,7 +118,7 @@ | |||
118 | * the hvcs_final_close() function in order to get it out of the spinlock. | 118 | * the hvcs_final_close() function in order to get it out of the spinlock. |
119 | * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping | 119 | * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping |
120 | * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from | 120 | * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from |
121 | * arch/ppc64/hvcserver.h. | 121 | * include/asm-powerpc/hvcserver.h |
122 | * | 122 | * |
123 | * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to | 123 | * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to |
124 | * prevent possible lockup with realtime scheduling as similarily pointed out by | 124 | * prevent possible lockup with realtime scheduling as similarily pointed out by |
@@ -168,9 +168,10 @@ MODULE_VERSION(HVCS_DRIVER_VERSION); | |||
168 | 168 | ||
169 | /* | 169 | /* |
170 | * The hcall interface involves putting 8 chars into each of two registers. | 170 | * The hcall interface involves putting 8 chars into each of two registers. |
171 | * We load up those 2 registers (in arch/ppc64/hvconsole.c) by casting char[16] | 171 | * We load up those 2 registers (in arch/powerpc/platforms/pseries/hvconsole.c) |
172 | * to long[2]. It would work without __ALIGNED__, but a little (tiny) bit | 172 | * by casting char[16] to long[2]. It would work without __ALIGNED__, but a |
173 | * slower because an unaligned load is slower than aligned load. | 173 | * little (tiny) bit slower because an unaligned load is slower than aligned |
174 | * load. | ||
174 | */ | 175 | */ |
175 | #define __ALIGNED__ __attribute__((__aligned__(8))) | 176 | #define __ALIGNED__ __attribute__((__aligned__(8))) |
176 | 177 | ||
diff --git a/drivers/char/hw_random.c b/drivers/char/hw_random.c index b3bc2e37e616..29dc87e59020 100644 --- a/drivers/char/hw_random.c +++ b/drivers/char/hw_random.c | |||
@@ -131,7 +131,9 @@ enum { | |||
131 | rng_hw_none, | 131 | rng_hw_none, |
132 | rng_hw_intel, | 132 | rng_hw_intel, |
133 | rng_hw_amd, | 133 | rng_hw_amd, |
134 | #ifdef __i386__ | ||
134 | rng_hw_via, | 135 | rng_hw_via, |
136 | #endif | ||
135 | rng_hw_geode, | 137 | rng_hw_geode, |
136 | }; | 138 | }; |
137 | 139 | ||
diff --git a/drivers/char/ip2/Makefile b/drivers/char/ip2/Makefile new file mode 100644 index 000000000000..6bfe2543ddc2 --- /dev/null +++ b/drivers/char/ip2/Makefile | |||
@@ -0,0 +1,8 @@ | |||
1 | # | ||
2 | # Makefile for the Computone IntelliPort Plus Driver | ||
3 | # | ||
4 | |||
5 | obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o | ||
6 | |||
7 | ip2-objs := ip2base.o | ||
8 | |||
diff --git a/drivers/char/ip2.c b/drivers/char/ip2/ip2base.c index 7cadfc6ef352..435ccfc74958 100644 --- a/drivers/char/ip2.c +++ b/drivers/char/ip2/ip2base.c | |||
@@ -20,14 +20,14 @@ | |||
20 | #define __initdata | 20 | #define __initdata |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #include "./ip2/ip2types.h" | 23 | #include "ip2types.h" |
24 | #include "./ip2/fip_firm.h" // the meat | 24 | #include "fip_firm.h" // the meat |
25 | 25 | ||
26 | int | 26 | int |
27 | ip2_loadmain(int *, int *, unsigned char *, int ); // ref into ip2main.c | 27 | ip2_loadmain(int *, int *, unsigned char *, int ); // ref into ip2main.c |
28 | 28 | ||
29 | /* Note: Add compiled in defaults to these arrays, not to the structure | 29 | /* Note: Add compiled in defaults to these arrays, not to the structure |
30 | in ip2/ip2.h any longer. That structure WILL get overridden | 30 | in ip2.h any longer. That structure WILL get overridden |
31 | by these values, or command line values, or insmod values!!! =mhw= | 31 | by these values, or command line values, or insmod values!!! =mhw= |
32 | */ | 32 | */ |
33 | static int io[IP2_MAX_BOARDS]= { 0, 0, 0, 0 }; | 33 | static int io[IP2_MAX_BOARDS]= { 0, 0, 0, 0 }; |
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2/ip2main.c index 48fcfba37bfa..03db1cb3fa95 100644 --- a/drivers/char/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -35,7 +35,7 @@ | |||
35 | // Clean up potential NULL pointer dereferences | 35 | // Clean up potential NULL pointer dereferences |
36 | // Clean up devfs registration | 36 | // Clean up devfs registration |
37 | // Add kernel command line parsing for io and irq | 37 | // Add kernel command line parsing for io and irq |
38 | // Compile defaults for io and irq are now set in ip2.c not ip2/ip2.h! | 38 | // Compile defaults for io and irq are now set in ip2.c not ip2.h! |
39 | // Reworked poll_only hack for explicit parameter setting | 39 | // Reworked poll_only hack for explicit parameter setting |
40 | // You must now EXPLICITLY set poll_only = 1 or set all irqs to 0 | 40 | // You must now EXPLICITLY set poll_only = 1 or set all irqs to 0 |
41 | // Merged ip2_loadmain and old_ip2_init | 41 | // Merged ip2_loadmain and old_ip2_init |
@@ -123,12 +123,12 @@ | |||
123 | 123 | ||
124 | #include <asm/uaccess.h> | 124 | #include <asm/uaccess.h> |
125 | 125 | ||
126 | #include "./ip2/ip2types.h" | 126 | #include "ip2types.h" |
127 | #include "./ip2/ip2trace.h" | 127 | #include "ip2trace.h" |
128 | #include "./ip2/ip2ioctl.h" | 128 | #include "ip2ioctl.h" |
129 | #include "./ip2/ip2.h" | 129 | #include "ip2.h" |
130 | #include "./ip2/i2ellis.h" | 130 | #include "i2ellis.h" |
131 | #include "./ip2/i2lib.h" | 131 | #include "i2lib.h" |
132 | 132 | ||
133 | /***************** | 133 | /***************** |
134 | * /proc/ip2mem * | 134 | * /proc/ip2mem * |
@@ -282,9 +282,9 @@ static int tracewrap; | |||
282 | /* Code */ | 282 | /* Code */ |
283 | /********/ | 283 | /********/ |
284 | 284 | ||
285 | #include "./ip2/i2ellis.c" /* Extremely low-level interface services */ | 285 | #include "i2ellis.c" /* Extremely low-level interface services */ |
286 | #include "./ip2/i2cmd.c" /* Standard loadware command definitions */ | 286 | #include "i2cmd.c" /* Standard loadware command definitions */ |
287 | #include "./ip2/i2lib.c" /* High level interface services */ | 287 | #include "i2lib.c" /* High level interface services */ |
288 | 288 | ||
289 | /* Configuration area for modprobe */ | 289 | /* Configuration area for modprobe */ |
290 | 290 | ||
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index c92378121b4c..1b05fa688996 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -675,7 +675,7 @@ static int __init mmtimer_init(void) | |||
675 | cnodeid_t node, maxn = -1; | 675 | cnodeid_t node, maxn = -1; |
676 | 676 | ||
677 | if (!ia64_platform_is("sn2")) | 677 | if (!ia64_platform_is("sn2")) |
678 | return -1; | 678 | return 0; |
679 | 679 | ||
680 | /* | 680 | /* |
681 | * Sanity check the cycles/sec variable | 681 | * Sanity check the cycles/sec variable |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 649677b5dc36..5fdf18515433 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -13,11 +13,12 @@ | |||
13 | * | 13 | * |
14 | * (C) 2000,2001,2002,2003,2004 Omnikey AG | 14 | * (C) 2000,2001,2002,2003,2004 Omnikey AG |
15 | * | 15 | * |
16 | * (C) 2005 Harald Welte <laforge@gnumonks.org> | 16 | * (C) 2005-2006 Harald Welte <laforge@gnumonks.org> |
17 | * - Adhere to Kernel CodingStyle | 17 | * - Adhere to Kernel CodingStyle |
18 | * - Port to 2.6.13 "new" style PCMCIA | 18 | * - Port to 2.6.13 "new" style PCMCIA |
19 | * - Check for copy_{from,to}_user return values | 19 | * - Check for copy_{from,to}_user return values |
20 | * - Use nonseekable_open() | 20 | * - Use nonseekable_open() |
21 | * - add class interface for udev device creation | ||
21 | * | 22 | * |
22 | * All rights reserved. Licensed under dual BSD/GPL license. | 23 | * All rights reserved. Licensed under dual BSD/GPL license. |
23 | */ | 24 | */ |
@@ -56,7 +57,7 @@ module_param(pc_debug, int, 0600); | |||
56 | #else | 57 | #else |
57 | #define DEBUGP(n, rdr, x, args...) | 58 | #define DEBUGP(n, rdr, x, args...) |
58 | #endif | 59 | #endif |
59 | static char *version = "cm4000_cs.c v2.4.0gm5 - All bugs added by Harald Welte"; | 60 | static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte"; |
60 | 61 | ||
61 | #define T_1SEC (HZ) | 62 | #define T_1SEC (HZ) |
62 | #define T_10MSEC msecs_to_jiffies(10) | 63 | #define T_10MSEC msecs_to_jiffies(10) |
@@ -156,6 +157,7 @@ struct cm4000_dev { | |||
156 | /*queue*/ 4*sizeof(wait_queue_head_t)) | 157 | /*queue*/ 4*sizeof(wait_queue_head_t)) |
157 | 158 | ||
158 | static dev_link_t *dev_table[CM4000_MAX_DEV]; | 159 | static dev_link_t *dev_table[CM4000_MAX_DEV]; |
160 | static struct class *cmm_class; | ||
159 | 161 | ||
160 | /* This table doesn't use spaces after the comma between fields and thus | 162 | /* This table doesn't use spaces after the comma between fields and thus |
161 | * violates CodingStyle. However, I don't really think wrapping it around will | 163 | * violates CodingStyle. However, I don't really think wrapping it around will |
@@ -1937,6 +1939,9 @@ static int cm4000_attach(struct pcmcia_device *p_dev) | |||
1937 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1939 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
1938 | cm4000_config(link, i); | 1940 | cm4000_config(link, i); |
1939 | 1941 | ||
1942 | class_device_create(cmm_class, NULL, MKDEV(major, i), NULL, | ||
1943 | "cmm%d", i); | ||
1944 | |||
1940 | return 0; | 1945 | return 0; |
1941 | } | 1946 | } |
1942 | 1947 | ||
@@ -1962,6 +1967,8 @@ static void cm4000_detach(struct pcmcia_device *p_dev) | |||
1962 | dev_table[devno] = NULL; | 1967 | dev_table[devno] = NULL; |
1963 | kfree(dev); | 1968 | kfree(dev); |
1964 | 1969 | ||
1970 | class_device_destroy(cmm_class, MKDEV(major, devno)); | ||
1971 | |||
1965 | return; | 1972 | return; |
1966 | } | 1973 | } |
1967 | 1974 | ||
@@ -1995,8 +2002,18 @@ static struct pcmcia_driver cm4000_driver = { | |||
1995 | 2002 | ||
1996 | static int __init cmm_init(void) | 2003 | static int __init cmm_init(void) |
1997 | { | 2004 | { |
2005 | int rc; | ||
2006 | |||
1998 | printk(KERN_INFO "%s\n", version); | 2007 | printk(KERN_INFO "%s\n", version); |
1999 | pcmcia_register_driver(&cm4000_driver); | 2008 | |
2009 | cmm_class = class_create(THIS_MODULE, "cardman_4000"); | ||
2010 | if (!cmm_class) | ||
2011 | return -1; | ||
2012 | |||
2013 | rc = pcmcia_register_driver(&cm4000_driver); | ||
2014 | if (rc < 0) | ||
2015 | return rc; | ||
2016 | |||
2000 | major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); | 2017 | major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); |
2001 | if (major < 0) { | 2018 | if (major < 0) { |
2002 | printk(KERN_WARNING MODULE_NAME | 2019 | printk(KERN_WARNING MODULE_NAME |
@@ -2012,6 +2029,7 @@ static void __exit cmm_exit(void) | |||
2012 | printk(KERN_INFO MODULE_NAME ": unloading\n"); | 2029 | printk(KERN_INFO MODULE_NAME ": unloading\n"); |
2013 | pcmcia_unregister_driver(&cm4000_driver); | 2030 | pcmcia_unregister_driver(&cm4000_driver); |
2014 | unregister_chrdev(major, DEVICE_NAME); | 2031 | unregister_chrdev(major, DEVICE_NAME); |
2032 | class_destroy(cmm_class); | ||
2015 | }; | 2033 | }; |
2016 | 2034 | ||
2017 | module_init(cmm_init); | 2035 | module_init(cmm_init); |
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 46eb371bf17e..466e33bab029 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -3,12 +3,13 @@ | |||
3 | * | 3 | * |
4 | * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/) | 4 | * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/) |
5 | * | 5 | * |
6 | * (C) 2005 Harald Welte <laforge@gnumonks.org> | 6 | * (C) 2005-2006 Harald Welte <laforge@gnumonks.org> |
7 | * - add support for poll() | 7 | * - add support for poll() |
8 | * - driver cleanup | 8 | * - driver cleanup |
9 | * - add waitqueues | 9 | * - add waitqueues |
10 | * - adhere to linux kernel coding style and policies | 10 | * - adhere to linux kernel coding style and policies |
11 | * - support 2.6.13 "new style" pcmcia interface | 11 | * - support 2.6.13 "new style" pcmcia interface |
12 | * - add class interface for udev device creation | ||
12 | * | 13 | * |
13 | * The device basically is a USB CCID compliant device that has been | 14 | * The device basically is a USB CCID compliant device that has been |
14 | * attached to an I/O-Mapped FIFO. | 15 | * attached to an I/O-Mapped FIFO. |
@@ -53,7 +54,7 @@ module_param(pc_debug, int, 0600); | |||
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | static char *version = | 56 | static char *version = |
56 | "OMNIKEY CardMan 4040 v1.1.0gm4 - All bugs added by Harald Welte"; | 57 | "OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte"; |
57 | 58 | ||
58 | #define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) | 59 | #define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) |
59 | #define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) | 60 | #define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) |
@@ -67,6 +68,7 @@ static char *version = | |||
67 | static void reader_release(dev_link_t *link); | 68 | static void reader_release(dev_link_t *link); |
68 | 69 | ||
69 | static int major; | 70 | static int major; |
71 | static struct class *cmx_class; | ||
70 | 72 | ||
71 | #define BS_READABLE 0x01 | 73 | #define BS_READABLE 0x01 |
72 | #define BS_WRITABLE 0x02 | 74 | #define BS_WRITABLE 0x02 |
@@ -696,6 +698,9 @@ static int reader_attach(struct pcmcia_device *p_dev) | |||
696 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 698 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
697 | reader_config(link, i); | 699 | reader_config(link, i); |
698 | 700 | ||
701 | class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, | ||
702 | "cmx%d", i); | ||
703 | |||
699 | return 0; | 704 | return 0; |
700 | } | 705 | } |
701 | 706 | ||
@@ -721,6 +726,8 @@ static void reader_detach(struct pcmcia_device *p_dev) | |||
721 | dev_table[devno] = NULL; | 726 | dev_table[devno] = NULL; |
722 | kfree(dev); | 727 | kfree(dev); |
723 | 728 | ||
729 | class_device_destroy(cmx_class, MKDEV(major, devno)); | ||
730 | |||
724 | return; | 731 | return; |
725 | } | 732 | } |
726 | 733 | ||
@@ -755,8 +762,17 @@ static struct pcmcia_driver reader_driver = { | |||
755 | 762 | ||
756 | static int __init cm4040_init(void) | 763 | static int __init cm4040_init(void) |
757 | { | 764 | { |
765 | int rc; | ||
766 | |||
758 | printk(KERN_INFO "%s\n", version); | 767 | printk(KERN_INFO "%s\n", version); |
759 | pcmcia_register_driver(&reader_driver); | 768 | cmx_class = class_create(THIS_MODULE, "cardman_4040"); |
769 | if (!cmx_class) | ||
770 | return -1; | ||
771 | |||
772 | rc = pcmcia_register_driver(&reader_driver); | ||
773 | if (rc < 0) | ||
774 | return rc; | ||
775 | |||
760 | major = register_chrdev(0, DEVICE_NAME, &reader_fops); | 776 | major = register_chrdev(0, DEVICE_NAME, &reader_fops); |
761 | if (major < 0) { | 777 | if (major < 0) { |
762 | printk(KERN_WARNING MODULE_NAME | 778 | printk(KERN_WARNING MODULE_NAME |
@@ -771,6 +787,7 @@ static void __exit cm4040_exit(void) | |||
771 | printk(KERN_INFO MODULE_NAME ": unloading\n"); | 787 | printk(KERN_INFO MODULE_NAME ": unloading\n"); |
772 | pcmcia_unregister_driver(&reader_driver); | 788 | pcmcia_unregister_driver(&reader_driver); |
773 | unregister_chrdev(major, DEVICE_NAME); | 789 | unregister_chrdev(major, DEVICE_NAME); |
790 | class_destroy(cmx_class); | ||
774 | } | 791 | } |
775 | 792 | ||
776 | module_init(cm4040_init); | 793 | module_init(cm4040_init); |
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c index 2e308657f6f6..b0038b19b505 100644 --- a/drivers/char/s3c2410-rtc.c +++ b/drivers/char/s3c2410-rtc.c | |||
@@ -448,13 +448,13 @@ static int s3c2410_rtc_probe(struct platform_device *pdev) | |||
448 | /* find the IRQs */ | 448 | /* find the IRQs */ |
449 | 449 | ||
450 | s3c2410_rtc_tickno = platform_get_irq(pdev, 1); | 450 | s3c2410_rtc_tickno = platform_get_irq(pdev, 1); |
451 | if (s3c2410_rtc_tickno <= 0) { | 451 | if (s3c2410_rtc_tickno < 0) { |
452 | dev_err(&pdev->dev, "no irq for rtc tick\n"); | 452 | dev_err(&pdev->dev, "no irq for rtc tick\n"); |
453 | return -ENOENT; | 453 | return -ENOENT; |
454 | } | 454 | } |
455 | 455 | ||
456 | s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); | 456 | s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); |
457 | if (s3c2410_rtc_alarmno <= 0) { | 457 | if (s3c2410_rtc_alarmno < 0) { |
458 | dev_err(&pdev->dev, "no irq for alarm\n"); | 458 | dev_err(&pdev->dev, "no irq for alarm\n"); |
459 | return -ENOENT; | 459 | return -ENOENT; |
460 | } | 460 | } |
diff --git a/drivers/char/snsc.h b/drivers/char/snsc.h index a9efc13cc858..8a98169b60c1 100644 --- a/drivers/char/snsc.h +++ b/drivers/char/snsc.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved. | 8 | * Copyright (C) 2004-2006 Silicon Graphics, Inc. All rights reserved. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | /* | 11 | /* |
@@ -70,6 +70,9 @@ struct sysctl_data_s { | |||
70 | #define EV_CLASS_TEST_WARNING 0x6000ul | 70 | #define EV_CLASS_TEST_WARNING 0x6000ul |
71 | #define EV_CLASS_PWRD_NOTIFY 0x8000ul | 71 | #define EV_CLASS_PWRD_NOTIFY 0x8000ul |
72 | 72 | ||
73 | /* ENV class codes */ | ||
74 | #define ENV_PWRDN_PEND 0x4101ul | ||
75 | |||
73 | #define EV_SEVERITY_POWER_STABLE 0x0000ul | 76 | #define EV_SEVERITY_POWER_STABLE 0x0000ul |
74 | #define EV_SEVERITY_POWER_LOW_WARNING 0x0100ul | 77 | #define EV_SEVERITY_POWER_LOW_WARNING 0x0100ul |
75 | #define EV_SEVERITY_POWER_HIGH_WARNING 0x0200ul | 78 | #define EV_SEVERITY_POWER_HIGH_WARNING 0x0200ul |
diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c index baaa365285fa..a4fa507eed9e 100644 --- a/drivers/char/snsc_event.c +++ b/drivers/char/snsc_event.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved. | 8 | * Copyright (C) 2004-2006 Silicon Graphics, Inc. All rights reserved. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | /* | 11 | /* |
@@ -187,7 +187,8 @@ scdrv_event_severity(int code) | |||
187 | static void | 187 | static void |
188 | scdrv_dispatch_event(char *event, int len) | 188 | scdrv_dispatch_event(char *event, int len) |
189 | { | 189 | { |
190 | int code, esp_code, src; | 190 | static int snsc_shutting_down = 0; |
191 | int code, esp_code, src, class; | ||
191 | char desc[CHUNKSIZE]; | 192 | char desc[CHUNKSIZE]; |
192 | char *severity; | 193 | char *severity; |
193 | 194 | ||
@@ -199,9 +200,25 @@ scdrv_dispatch_event(char *event, int len) | |||
199 | /* how urgent is the message? */ | 200 | /* how urgent is the message? */ |
200 | severity = scdrv_event_severity(code); | 201 | severity = scdrv_event_severity(code); |
201 | 202 | ||
202 | if ((code & EV_CLASS_MASK) == EV_CLASS_PWRD_NOTIFY) { | 203 | class = (code & EV_CLASS_MASK); |
204 | |||
205 | if (class == EV_CLASS_PWRD_NOTIFY || code == ENV_PWRDN_PEND) { | ||
203 | struct task_struct *p; | 206 | struct task_struct *p; |
204 | 207 | ||
208 | if (snsc_shutting_down) | ||
209 | return; | ||
210 | |||
211 | snsc_shutting_down = 1; | ||
212 | |||
213 | /* give a message for each type of event */ | ||
214 | if (class == EV_CLASS_PWRD_NOTIFY) | ||
215 | printk(KERN_NOTICE "Power off indication received." | ||
216 | " Sending SIGPWR to init...\n"); | ||
217 | else if (code == ENV_PWRDN_PEND) | ||
218 | printk(KERN_CRIT "WARNING: Shutting down the system" | ||
219 | " due to a critical environmental condition." | ||
220 | " Sending SIGPWR to init...\n"); | ||
221 | |||
205 | /* give a SIGPWR signal to init proc */ | 222 | /* give a SIGPWR signal to init proc */ |
206 | 223 | ||
207 | /* first find init's task */ | 224 | /* first find init's task */ |
@@ -210,12 +227,11 @@ scdrv_dispatch_event(char *event, int len) | |||
210 | if (p->pid == 1) | 227 | if (p->pid == 1) |
211 | break; | 228 | break; |
212 | } | 229 | } |
213 | if (p) { /* we found init's task */ | 230 | if (p) { |
214 | printk(KERN_EMERG "Power off indication received. Initiating power fail sequence...\n"); | ||
215 | force_sig(SIGPWR, p); | 231 | force_sig(SIGPWR, p); |
216 | } else { /* failed to find init's task - just give message(s) */ | 232 | } else { |
217 | printk(KERN_WARNING "Failed to find init proc to handle power off!\n"); | 233 | printk(KERN_ERR "Failed to signal init!\n"); |
218 | printk("%s|$(0x%x)%s\n", severity, esp_code, desc); | 234 | snsc_shutting_down = 0; /* so can try again (?) */ |
219 | } | 235 | } |
220 | read_unlock(&tasklist_lock); | 236 | read_unlock(&tasklist_lock); |
221 | } else { | 237 | } else { |
diff --git a/drivers/char/sx.c b/drivers/char/sx.c index c2490e270f1f..a6b4f02bdceb 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c | |||
@@ -1095,17 +1095,17 @@ static inline void sx_receive_chars (struct sx_port *port) | |||
1095 | 1095 | ||
1096 | sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); | 1096 | sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); |
1097 | 1097 | ||
1098 | /* Don't copy past the end of the hardware receive buffer */ | ||
1099 | if (rx_op + c > 0x100) c = 0x100 - rx_op; | ||
1100 | |||
1101 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); | ||
1102 | |||
1098 | /* Don't copy more bytes than there is room for in the buffer */ | 1103 | /* Don't copy more bytes than there is room for in the buffer */ |
1099 | 1104 | ||
1100 | c = tty_prepare_flip_string(tty, &rp, c); | 1105 | c = tty_prepare_flip_string(tty, &rp, c); |
1101 | 1106 | ||
1102 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); | 1107 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); |
1103 | 1108 | ||
1104 | /* Don't copy past the end of the hardware receive buffer */ | ||
1105 | if (rx_op + c > 0x100) c = 0x100 - rx_op; | ||
1106 | |||
1107 | sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); | ||
1108 | |||
1109 | /* If for one reason or another, we can't copy more data, we're done! */ | 1109 | /* If for one reason or another, we can't copy more data, we're done! */ |
1110 | if (c == 0) break; | 1110 | if (c == 0) break; |
1111 | 1111 | ||
@@ -2173,15 +2173,17 @@ static int probe_si (struct sx_board *board) | |||
2173 | if ( IS_SI1_BOARD(board)) { | 2173 | if ( IS_SI1_BOARD(board)) { |
2174 | /* This should be an SI1 board, which has this | 2174 | /* This should be an SI1 board, which has this |
2175 | location writable... */ | 2175 | location writable... */ |
2176 | if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) | 2176 | if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) { |
2177 | func_exit (); | 2177 | func_exit (); |
2178 | return 0; | 2178 | return 0; |
2179 | } | ||
2179 | } else { | 2180 | } else { |
2180 | /* This should be an SI2 board, which has the bottom | 2181 | /* This should be an SI2 board, which has the bottom |
2181 | 3 bits non-writable... */ | 2182 | 3 bits non-writable... */ |
2182 | if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) | 2183 | if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) { |
2183 | func_exit (); | 2184 | func_exit (); |
2184 | return 0; | 2185 | return 0; |
2186 | } | ||
2185 | } | 2187 | } |
2186 | 2188 | ||
2187 | /* Now we're pretty much convinced that there is an SI board here, | 2189 | /* Now we're pretty much convinced that there is an SI board here, |
@@ -2192,15 +2194,17 @@ static int probe_si (struct sx_board *board) | |||
2192 | if ( IS_SI1_BOARD(board)) { | 2194 | if ( IS_SI1_BOARD(board)) { |
2193 | /* This should be an SI1 board, which has this | 2195 | /* This should be an SI1 board, which has this |
2194 | location writable... */ | 2196 | location writable... */ |
2195 | if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) | 2197 | if (read_sx_byte (board, SI2_ISA_ID_BASE) != 0x10) { |
2196 | func_exit(); | 2198 | func_exit(); |
2197 | return 0; | 2199 | return 0; |
2200 | } | ||
2198 | } else { | 2201 | } else { |
2199 | /* This should be an SI2 board, which has the bottom | 2202 | /* This should be an SI2 board, which has the bottom |
2200 | 3 bits non-writable... */ | 2203 | 3 bits non-writable... */ |
2201 | if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) | 2204 | if (read_sx_byte (board, SI2_ISA_ID_BASE) == 0x10) { |
2202 | func_exit (); | 2205 | func_exit (); |
2203 | return 0; | 2206 | return 0; |
2207 | } | ||
2204 | } | 2208 | } |
2205 | 2209 | ||
2206 | printheader (); | 2210 | printheader (); |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index a85a60a93deb..b046390cd256 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -306,7 +306,7 @@ struct slgt_info { | |||
306 | int tx_active; | 306 | int tx_active; |
307 | 307 | ||
308 | unsigned char signals; /* serial signal states */ | 308 | unsigned char signals; /* serial signal states */ |
309 | unsigned int init_error; /* initialization error */ | 309 | int init_error; /* initialization error */ |
310 | 310 | ||
311 | unsigned char *tx_buf; | 311 | unsigned char *tx_buf; |
312 | int tx_count; | 312 | int tx_count; |
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c index ac2a297ce37c..a80c83210872 100644 --- a/drivers/char/tb0219.c +++ b/drivers/char/tb0219.c | |||
@@ -283,7 +283,7 @@ static void tb0219_pci_irq_init(void) | |||
283 | vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); | 283 | vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); |
284 | } | 284 | } |
285 | 285 | ||
286 | static int tb0219_probe(struct platform_device *dev) | 286 | static int __devinit tb0219_probe(struct platform_device *dev) |
287 | { | 287 | { |
288 | int retval; | 288 | int retval; |
289 | 289 | ||
@@ -319,7 +319,7 @@ static int tb0219_probe(struct platform_device *dev) | |||
319 | return 0; | 319 | return 0; |
320 | } | 320 | } |
321 | 321 | ||
322 | static int tb0219_remove(struct platform_device *dev) | 322 | static int __devexit tb0219_remove(struct platform_device *dev) |
323 | { | 323 | { |
324 | _machine_restart = old_machine_restart; | 324 | _machine_restart = old_machine_restart; |
325 | 325 | ||
@@ -335,19 +335,26 @@ static struct platform_device *tb0219_platform_device; | |||
335 | 335 | ||
336 | static struct platform_driver tb0219_device_driver = { | 336 | static struct platform_driver tb0219_device_driver = { |
337 | .probe = tb0219_probe, | 337 | .probe = tb0219_probe, |
338 | .remove = tb0219_remove, | 338 | .remove = __devexit_p(tb0219_remove), |
339 | .driver = { | 339 | .driver = { |
340 | .name = "TB0219", | 340 | .name = "TB0219", |
341 | .owner = THIS_MODULE, | ||
341 | }, | 342 | }, |
342 | }; | 343 | }; |
343 | 344 | ||
344 | static int __devinit tanbac_tb0219_init(void) | 345 | static int __init tanbac_tb0219_init(void) |
345 | { | 346 | { |
346 | int retval; | 347 | int retval; |
347 | 348 | ||
348 | tb0219_platform_device = platform_device_register_simple("TB0219", -1, NULL, 0); | 349 | tb0219_platform_device = platform_device_alloc("TB0219", -1); |
349 | if (IS_ERR(tb0219_platform_device)) | 350 | if (!tb0219_platform_device) |
350 | return PTR_ERR(tb0219_platform_device); | 351 | return -ENOMEM; |
352 | |||
353 | retval = platform_device_add(tb0219_platform_device); | ||
354 | if (retval < 0) { | ||
355 | platform_device_put(tb0219_platform_device); | ||
356 | return retval; | ||
357 | } | ||
351 | 358 | ||
352 | retval = platform_driver_register(&tb0219_device_driver); | 359 | retval = platform_driver_register(&tb0219_device_driver); |
353 | if (retval < 0) | 360 | if (retval < 0) |
@@ -356,10 +363,9 @@ static int __devinit tanbac_tb0219_init(void) | |||
356 | return retval; | 363 | return retval; |
357 | } | 364 | } |
358 | 365 | ||
359 | static void __devexit tanbac_tb0219_exit(void) | 366 | static void __exit tanbac_tb0219_exit(void) |
360 | { | 367 | { |
361 | platform_driver_unregister(&tb0219_device_driver); | 368 | platform_driver_unregister(&tb0219_device_driver); |
362 | |||
363 | platform_device_unregister(tb0219_platform_device); | 369 | platform_device_unregister(tb0219_platform_device); |
364 | } | 370 | } |
365 | 371 | ||
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e9bba94fc898..53d3d066554e 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -303,7 +303,7 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size) | |||
303 | t->commit = 0; | 303 | t->commit = 0; |
304 | t->read = 0; | 304 | t->read = 0; |
305 | /* DEBUG ONLY */ | 305 | /* DEBUG ONLY */ |
306 | memset(t->data, '*', size); | 306 | /* memset(t->data, '*', size); */ |
307 | /* printk("Flip recycle %p\n", t); */ | 307 | /* printk("Flip recycle %p\n", t); */ |
308 | return t; | 308 | return t; |
309 | } | 309 | } |
diff --git a/drivers/char/vr41xx_giu.c b/drivers/char/vr41xx_giu.c index 2267c7b81799..05e6e814d86f 100644 --- a/drivers/char/vr41xx_giu.c +++ b/drivers/char/vr41xx_giu.c | |||
@@ -613,7 +613,7 @@ static struct file_operations gpio_fops = { | |||
613 | .release = gpio_release, | 613 | .release = gpio_release, |
614 | }; | 614 | }; |
615 | 615 | ||
616 | static int giu_probe(struct platform_device *dev) | 616 | static int __devinit giu_probe(struct platform_device *dev) |
617 | { | 617 | { |
618 | unsigned long start, size, flags = 0; | 618 | unsigned long start, size, flags = 0; |
619 | unsigned int nr_pins = 0; | 619 | unsigned int nr_pins = 0; |
@@ -697,7 +697,7 @@ static int giu_probe(struct platform_device *dev) | |||
697 | return cascade_irq(GIUINT_IRQ, giu_get_irq); | 697 | return cascade_irq(GIUINT_IRQ, giu_get_irq); |
698 | } | 698 | } |
699 | 699 | ||
700 | static int giu_remove(struct platform_device *dev) | 700 | static int __devexit giu_remove(struct platform_device *dev) |
701 | { | 701 | { |
702 | iounmap(giu_base); | 702 | iounmap(giu_base); |
703 | 703 | ||
@@ -712,9 +712,10 @@ static struct platform_device *giu_platform_device; | |||
712 | 712 | ||
713 | static struct platform_driver giu_device_driver = { | 713 | static struct platform_driver giu_device_driver = { |
714 | .probe = giu_probe, | 714 | .probe = giu_probe, |
715 | .remove = giu_remove, | 715 | .remove = __devexit_p(giu_remove), |
716 | .driver = { | 716 | .driver = { |
717 | .name = "GIU", | 717 | .name = "GIU", |
718 | .owner = THIS_MODULE, | ||
718 | }, | 719 | }, |
719 | }; | 720 | }; |
720 | 721 | ||
@@ -722,9 +723,15 @@ static int __init vr41xx_giu_init(void) | |||
722 | { | 723 | { |
723 | int retval; | 724 | int retval; |
724 | 725 | ||
725 | giu_platform_device = platform_device_register_simple("GIU", -1, NULL, 0); | 726 | giu_platform_device = platform_device_alloc("GIU", -1); |
726 | if (IS_ERR(giu_platform_device)) | 727 | if (!giu_platform_device) |
727 | return PTR_ERR(giu_platform_device); | 728 | return -ENOMEM; |
729 | |||
730 | retval = platform_device_add(giu_platform_device); | ||
731 | if (retval < 0) { | ||
732 | platform_device_put(giu_platform_device); | ||
733 | return retval; | ||
734 | } | ||
728 | 735 | ||
729 | retval = platform_driver_register(&giu_device_driver); | 736 | retval = platform_driver_register(&giu_device_driver); |
730 | if (retval < 0) | 737 | if (retval < 0) |
diff --git a/drivers/char/vr41xx_rtc.c b/drivers/char/vr41xx_rtc.c index bc1b4a15212c..b109d9a502d6 100644 --- a/drivers/char/vr41xx_rtc.c +++ b/drivers/char/vr41xx_rtc.c | |||
@@ -558,7 +558,7 @@ static struct miscdevice rtc_miscdevice = { | |||
558 | .fops = &rtc_fops, | 558 | .fops = &rtc_fops, |
559 | }; | 559 | }; |
560 | 560 | ||
561 | static int rtc_probe(struct platform_device *pdev) | 561 | static int __devinit rtc_probe(struct platform_device *pdev) |
562 | { | 562 | { |
563 | unsigned int irq; | 563 | unsigned int irq; |
564 | int retval; | 564 | int retval; |
@@ -631,7 +631,7 @@ static int rtc_probe(struct platform_device *pdev) | |||
631 | return 0; | 631 | return 0; |
632 | } | 632 | } |
633 | 633 | ||
634 | static int rtc_remove(struct platform_device *dev) | 634 | static int __devexit rtc_remove(struct platform_device *dev) |
635 | { | 635 | { |
636 | int retval; | 636 | int retval; |
637 | 637 | ||
@@ -653,13 +653,14 @@ static struct platform_device *rtc_platform_device; | |||
653 | 653 | ||
654 | static struct platform_driver rtc_device_driver = { | 654 | static struct platform_driver rtc_device_driver = { |
655 | .probe = rtc_probe, | 655 | .probe = rtc_probe, |
656 | .remove = rtc_remove, | 656 | .remove = __devexit_p(rtc_remove), |
657 | .driver = { | 657 | .driver = { |
658 | .name = rtc_name, | 658 | .name = rtc_name, |
659 | .owner = THIS_MODULE, | ||
659 | }, | 660 | }, |
660 | }; | 661 | }; |
661 | 662 | ||
662 | static int __devinit vr41xx_rtc_init(void) | 663 | static int __init vr41xx_rtc_init(void) |
663 | { | 664 | { |
664 | int retval; | 665 | int retval; |
665 | 666 | ||
@@ -684,10 +685,20 @@ static int __devinit vr41xx_rtc_init(void) | |||
684 | break; | 685 | break; |
685 | } | 686 | } |
686 | 687 | ||
687 | rtc_platform_device = platform_device_register_simple("RTC", -1, | 688 | rtc_platform_device = platform_device_alloc("RTC", -1); |
688 | rtc_resource, ARRAY_SIZE(rtc_resource)); | 689 | if (!rtc_platform_device) |
689 | if (IS_ERR(rtc_platform_device)) | 690 | return -ENOMEM; |
690 | return PTR_ERR(rtc_platform_device); | 691 | |
692 | retval = platform_device_add_resources(rtc_platform_device, | ||
693 | rtc_resource, ARRAY_SIZE(rtc_resource)); | ||
694 | |||
695 | if (retval == 0) | ||
696 | retval = platform_device_add(rtc_platform_device); | ||
697 | |||
698 | if (retval < 0) { | ||
699 | platform_device_put(rtc_platform_device); | ||
700 | return retval; | ||
701 | } | ||
691 | 702 | ||
692 | retval = platform_driver_register(&rtc_device_driver); | 703 | retval = platform_driver_register(&rtc_device_driver); |
693 | if (retval < 0) | 704 | if (retval < 0) |
@@ -696,10 +707,9 @@ static int __devinit vr41xx_rtc_init(void) | |||
696 | return retval; | 707 | return retval; |
697 | } | 708 | } |
698 | 709 | ||
699 | static void __devexit vr41xx_rtc_exit(void) | 710 | static void __exit vr41xx_rtc_exit(void) |
700 | { | 711 | { |
701 | platform_driver_unregister(&rtc_device_driver); | 712 | platform_driver_unregister(&rtc_device_driver); |
702 | |||
703 | platform_device_unregister(rtc_platform_device); | 713 | platform_device_unregister(rtc_platform_device); |
704 | } | 714 | } |
705 | 715 | ||
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c index b4d843489881..2c2c51773200 100644 --- a/drivers/char/watchdog/mpcore_wdt.c +++ b/drivers/char/watchdog/mpcore_wdt.c | |||
@@ -338,6 +338,10 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev) | |||
338 | 338 | ||
339 | wdt->dev = &dev->dev; | 339 | wdt->dev = &dev->dev; |
340 | wdt->irq = platform_get_irq(dev, 0); | 340 | wdt->irq = platform_get_irq(dev, 0); |
341 | if (wdt->irq < 0) { | ||
342 | ret = -ENXIO; | ||
343 | goto err_free; | ||
344 | } | ||
341 | wdt->base = ioremap(res->start, res->end - res->start + 1); | 345 | wdt->base = ioremap(res->start, res->end - res->start + 1); |
342 | if (!wdt->base) { | 346 | if (!wdt->base) { |
343 | ret = -ENOMEM; | 347 | ret = -ENOMEM; |
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c index 00d9ef04a369..f1b9cf89f153 100644 --- a/drivers/char/watchdog/mv64x60_wdt.c +++ b/drivers/char/watchdog/mv64x60_wdt.c | |||
@@ -228,15 +228,25 @@ static int __init mv64x60_wdt_init(void) | |||
228 | 228 | ||
229 | printk(KERN_INFO "MV64x60 watchdog driver\n"); | 229 | printk(KERN_INFO "MV64x60 watchdog driver\n"); |
230 | 230 | ||
231 | mv64x60_wdt_dev = platform_device_register_simple(MV64x60_WDT_NAME, | 231 | mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1); |
232 | -1, NULL, 0); | 232 | if (!mv64x60_wdt_dev) { |
233 | if (IS_ERR(mv64x60_wdt_dev)) { | 233 | ret = -ENOMEM; |
234 | ret = PTR_ERR(mv64x60_wdt_dev); | 234 | goto out; |
235 | } | ||
236 | |||
237 | ret = platform_device_add(mv64x60_wdt_dev); | ||
238 | if (ret) { | ||
239 | platform_device_put(mv64x60_wdt_dev); | ||
235 | goto out; | 240 | goto out; |
236 | } | 241 | } |
237 | 242 | ||
238 | ret = platform_driver_register(&mv64x60_wdt_driver); | 243 | ret = platform_driver_register(&mv64x60_wdt_driver); |
239 | out: | 244 | if (ret) { |
245 | platform_device_unregister(mv64x60_wdt_dev); | ||
246 | goto out; | ||
247 | } | ||
248 | |||
249 | out: | ||
240 | return ret; | 250 | return ret; |
241 | } | 251 | } |
242 | 252 | ||