diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-10-23 08:21:27 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2012-11-26 17:28:46 -0500 |
commit | f87ef101056a34d69d7aa2611da0eb95ff4414f9 (patch) | |
tree | ea81695847315a81d45cd46be199ce09626260ac /drivers/leds | |
parent | 50e5194385a7be0f3c6b1f97749854cf29562619 (diff) |
leds: leds-cobalt-qube: 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-qube.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/leds/leds-cobalt-qube.c b/drivers/leds/leds-cobalt-qube.c index 6a8725cc7b4d..86d6db74efd8 100644 --- a/drivers/leds/leds-cobalt-qube.c +++ b/drivers/leds/leds-cobalt-qube.c | |||
@@ -43,7 +43,7 @@ static int __devinit cobalt_qube_led_probe(struct platform_device *pdev) | |||
43 | if (!res) | 43 | if (!res) |
44 | return -EBUSY; | 44 | return -EBUSY; |
45 | 45 | ||
46 | led_port = ioremap(res->start, resource_size(res)); | 46 | led_port = devm_ioremap(&pdev->dev, res->start, resource_size(res)); |
47 | if (!led_port) | 47 | if (!led_port) |
48 | return -ENOMEM; | 48 | return -ENOMEM; |
49 | 49 | ||
@@ -52,12 +52,11 @@ static int __devinit cobalt_qube_led_probe(struct platform_device *pdev) | |||
52 | 52 | ||
53 | retval = led_classdev_register(&pdev->dev, &qube_front_led); | 53 | retval = led_classdev_register(&pdev->dev, &qube_front_led); |
54 | if (retval) | 54 | if (retval) |
55 | goto err_iounmap; | 55 | goto err_null; |
56 | 56 | ||
57 | return 0; | 57 | return 0; |
58 | 58 | ||
59 | err_iounmap: | 59 | err_null: |
60 | iounmap(led_port); | ||
61 | led_port = NULL; | 60 | led_port = NULL; |
62 | 61 | ||
63 | return retval; | 62 | return retval; |
@@ -67,10 +66,8 @@ static int __devexit cobalt_qube_led_remove(struct platform_device *pdev) | |||
67 | { | 66 | { |
68 | led_classdev_unregister(&qube_front_led); | 67 | led_classdev_unregister(&qube_front_led); |
69 | 68 | ||
70 | if (led_port) { | 69 | if (led_port) |
71 | iounmap(led_port); | ||
72 | led_port = NULL; | 70 | led_port = NULL; |
73 | } | ||
74 | 71 | ||
75 | return 0; | 72 | return 0; |
76 | } | 73 | } |