leds: leds-cobalt-raq: use devm_ioremap
[~shefty/rdma-dev.git] / drivers / leds / leds-cobalt-raq.c
index aac1c073fe7bb20b018553c7e5c89e0fe084a8cc..7e41aa91bc560bcfb47bead87b3f1642024b39f6 100644 (file)
@@ -85,13 +85,13 @@ static int __devinit cobalt_raq_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;
 
        retval = led_classdev_register(&pdev->dev, &raq_power_off_led);
        if (retval)
-               goto err_iounmap;
+               goto err_null;
 
        retval = led_classdev_register(&pdev->dev, &raq_web_led);
        if (retval)
@@ -102,8 +102,7 @@ static int __devinit cobalt_raq_led_probe(struct platform_device *pdev)
 err_unregister:
        led_classdev_unregister(&raq_power_off_led);
 
-err_iounmap:
-       iounmap(led_port);
+err_null:
        led_port = NULL;
 
        return retval;
@@ -114,10 +113,8 @@ static int __devexit cobalt_raq_led_remove(struct platform_device *pdev)
        led_classdev_unregister(&raq_power_off_led);
        led_classdev_unregister(&raq_web_led);
 
-       if (led_port) {
-               iounmap(led_port);
+       if (led_port)
                led_port = NULL;
-       }
 
        return 0;
 }