diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-03-24 09:24:04 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-24 09:24:04 -0500 |
commit | 11ed56fb7899f9eb9eaef8e5919db1bf08f1b07e (patch) | |
tree | b01421cb139b11065d776ed361a7a12b3a1aecc9 /drivers/char | |
parent | 54da9a3968448681d0ddf193ec90f2480c5cba1c (diff) | |
parent | 2cc432eed0491df66e14b578139bba2c75fb3f9a (diff) |
Merge branch 'upstream'
Conflicts:
drivers/scsi/sata_vsc.c
Diffstat (limited to 'drivers/char')
-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/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/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/tb0219.c | 24 | ||||
-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 |
14 files changed, 122 insertions, 57 deletions
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/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/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/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/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 | ||