diff options
Diffstat (limited to 'drivers/leds/leds-cobalt-qube.c')
-rw-r--r-- | drivers/leds/leds-cobalt-qube.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/leds/leds-cobalt-qube.c b/drivers/leds/leds-cobalt-qube.c index 6a8725cc7b4d..8abcb66db01c 100644 --- a/drivers/leds/leds-cobalt-qube.c +++ b/drivers/leds/leds-cobalt-qube.c @@ -34,7 +34,7 @@ static struct led_classdev qube_front_led = { .default_trigger = "default-on", }; -static int __devinit cobalt_qube_led_probe(struct platform_device *pdev) +static int cobalt_qube_led_probe(struct platform_device *pdev) { struct resource *res; int retval; @@ -43,7 +43,7 @@ static int __devinit cobalt_qube_led_probe(struct platform_device *pdev) if (!res) return -EBUSY; - led_port = ioremap(res->start, resource_size(res)); + led_port = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!led_port) return -ENOMEM; @@ -52,32 +52,29 @@ static int __devinit cobalt_qube_led_probe(struct platform_device *pdev) retval = led_classdev_register(&pdev->dev, &qube_front_led); if (retval) - goto err_iounmap; + goto err_null; return 0; -err_iounmap: - iounmap(led_port); +err_null: led_port = NULL; return retval; } -static int __devexit cobalt_qube_led_remove(struct platform_device *pdev) +static int cobalt_qube_led_remove(struct platform_device *pdev) { led_classdev_unregister(&qube_front_led); - if (led_port) { - iounmap(led_port); + if (led_port) led_port = NULL; - } return 0; } static struct platform_driver cobalt_qube_led_driver = { .probe = cobalt_qube_led_probe, - .remove = __devexit_p(cobalt_qube_led_remove), + .remove = cobalt_qube_led_remove, .driver = { .name = "cobalt-qube-leds", .owner = THIS_MODULE, |