diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-10-23 05:20:50 -0700 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2012-11-26 14:28:45 -0800 |
commit | 50e5194385a7be0f3c6b1f97749854cf29562619 (patch) | |
tree | 197066f95ea320f8059916ad8ea6225ebdf86144 /drivers/leds | |
parent | aa2dcf9dc150d4d077d8fa4a19f6e05196e9b9a5 (diff) | |
download | linux-50e5194385a7be0f3c6b1f97749854cf29562619.tar.bz2 |
leds: leds-cobalt-raq: use devm_ioremap
The devm_ functions allocate memory that is released when a driver
detaches. This patch uses devm_ioremap() for these functions.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-cobalt-raq.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/leds/leds-cobalt-raq.c b/drivers/leds/leds-cobalt-raq.c index aac1c073fe7b..7e41aa91bc56 100644 --- a/drivers/leds/leds-cobalt-raq.c +++ b/drivers/leds/leds-cobalt-raq.c @@ -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; } |