diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/drm/drm_vm.c | 1 | ||||
-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/mv64x60_wdt.c | 20 |
5 files changed, 64 insertions, 30 deletions
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) #endif offset = dev->driver->get_reg_ofs(dev); #ifdef __sparc__ + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); if (io_remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start, (map->offset + offset) >> PAGE_SHIFT, vma->vm_end - vma->vm_start, 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) vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); } -static int tb0219_probe(struct platform_device *dev) +static int __devinit tb0219_probe(struct platform_device *dev) { int retval; @@ -319,7 +319,7 @@ static int tb0219_probe(struct platform_device *dev) return 0; } -static int tb0219_remove(struct platform_device *dev) +static int __devexit tb0219_remove(struct platform_device *dev) { _machine_restart = old_machine_restart; @@ -335,19 +335,26 @@ static struct platform_device *tb0219_platform_device; static struct platform_driver tb0219_device_driver = { .probe = tb0219_probe, - .remove = tb0219_remove, + .remove = __devexit_p(tb0219_remove), .driver = { .name = "TB0219", + .owner = THIS_MODULE, }, }; -static int __devinit tanbac_tb0219_init(void) +static int __init tanbac_tb0219_init(void) { int retval; - tb0219_platform_device = platform_device_register_simple("TB0219", -1, NULL, 0); - if (IS_ERR(tb0219_platform_device)) - return PTR_ERR(tb0219_platform_device); + tb0219_platform_device = platform_device_alloc("TB0219", -1); + if (!tb0219_platform_device) + return -ENOMEM; + + retval = platform_device_add(tb0219_platform_device); + if (retval < 0) { + platform_device_put(tb0219_platform_device); + return retval; + } retval = platform_driver_register(&tb0219_device_driver); if (retval < 0) @@ -356,10 +363,9 @@ static int __devinit tanbac_tb0219_init(void) return retval; } -static void __devexit tanbac_tb0219_exit(void) +static void __exit tanbac_tb0219_exit(void) { platform_driver_unregister(&tb0219_device_driver); - platform_device_unregister(tb0219_platform_device); } 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 = { .release = gpio_release, }; -static int giu_probe(struct platform_device *dev) +static int __devinit giu_probe(struct platform_device *dev) { unsigned long start, size, flags = 0; unsigned int nr_pins = 0; @@ -697,7 +697,7 @@ static int giu_probe(struct platform_device *dev) return cascade_irq(GIUINT_IRQ, giu_get_irq); } -static int giu_remove(struct platform_device *dev) +static int __devexit giu_remove(struct platform_device *dev) { iounmap(giu_base); @@ -712,9 +712,10 @@ static struct platform_device *giu_platform_device; static struct platform_driver giu_device_driver = { .probe = giu_probe, - .remove = giu_remove, + .remove = __devexit_p(giu_remove), .driver = { .name = "GIU", + .owner = THIS_MODULE, }, }; @@ -722,9 +723,15 @@ static int __init vr41xx_giu_init(void) { int retval; - giu_platform_device = platform_device_register_simple("GIU", -1, NULL, 0); - if (IS_ERR(giu_platform_device)) - return PTR_ERR(giu_platform_device); + giu_platform_device = platform_device_alloc("GIU", -1); + if (!giu_platform_device) + return -ENOMEM; + + retval = platform_device_add(giu_platform_device); + if (retval < 0) { + platform_device_put(giu_platform_device); + return retval; + } retval = platform_driver_register(&giu_device_driver); 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 = { .fops = &rtc_fops, }; -static int rtc_probe(struct platform_device *pdev) +static int __devinit rtc_probe(struct platform_device *pdev) { unsigned int irq; int retval; @@ -631,7 +631,7 @@ static int rtc_probe(struct platform_device *pdev) return 0; } -static int rtc_remove(struct platform_device *dev) +static int __devexit rtc_remove(struct platform_device *dev) { int retval; @@ -653,13 +653,14 @@ static struct platform_device *rtc_platform_device; static struct platform_driver rtc_device_driver = { .probe = rtc_probe, - .remove = rtc_remove, + .remove = __devexit_p(rtc_remove), .driver = { .name = rtc_name, + .owner = THIS_MODULE, }, }; -static int __devinit vr41xx_rtc_init(void) +static int __init vr41xx_rtc_init(void) { int retval; @@ -684,10 +685,20 @@ static int __devinit vr41xx_rtc_init(void) break; } - rtc_platform_device = platform_device_register_simple("RTC", -1, - rtc_resource, ARRAY_SIZE(rtc_resource)); - if (IS_ERR(rtc_platform_device)) - return PTR_ERR(rtc_platform_device); + rtc_platform_device = platform_device_alloc("RTC", -1); + if (!rtc_platform_device) + return -ENOMEM; + + retval = platform_device_add_resources(rtc_platform_device, + rtc_resource, ARRAY_SIZE(rtc_resource)); + + if (retval == 0) + retval = platform_device_add(rtc_platform_device); + + if (retval < 0) { + platform_device_put(rtc_platform_device); + return retval; + } retval = platform_driver_register(&rtc_device_driver); if (retval < 0) @@ -696,10 +707,9 @@ static int __devinit vr41xx_rtc_init(void) return retval; } -static void __devexit vr41xx_rtc_exit(void) +static void __exit vr41xx_rtc_exit(void) { platform_driver_unregister(&rtc_device_driver); - platform_device_unregister(rtc_platform_device); } 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) printk(KERN_INFO "MV64x60 watchdog driver\n"); - mv64x60_wdt_dev = platform_device_register_simple(MV64x60_WDT_NAME, - -1, NULL, 0); - if (IS_ERR(mv64x60_wdt_dev)) { - ret = PTR_ERR(mv64x60_wdt_dev); + mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1); + if (!mv64x60_wdt_dev) { + ret = -ENOMEM; + goto out; + } + + ret = platform_device_add(mv64x60_wdt_dev); + if (ret) { + platform_device_put(mv64x60_wdt_dev); goto out; } ret = platform_driver_register(&mv64x60_wdt_driver); - out: + if (ret) { + platform_device_unregister(mv64x60_wdt_dev); + goto out; + } + + out: return ret; } |