diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-10-23 08:19:41 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2012-11-26 17:28:45 -0500 |
commit | aa2dcf9dc150d4d077d8fa4a19f6e05196e9b9a5 (patch) | |
tree | 041dda65331b8577b447f3f70e96c6703c4ebc3c /drivers/leds/leds-fsg.c | |
parent | b0053aaa23907cb3e10e6d13923b9afd735c7272 (diff) |
leds: leds-fsg: 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/leds-fsg.c')
-rw-r--r-- | drivers/leds/leds-fsg.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/leds/leds-fsg.c b/drivers/leds/leds-fsg.c index b9053fa6e253..b4d5a44cc41b 100644 --- a/drivers/leds/leds-fsg.c +++ b/drivers/leds/leds-fsg.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/leds.h> | 21 | #include <linux/leds.h> |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/io.h> | ||
23 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
24 | #include <asm/io.h> | ||
25 | 25 | ||
26 | #define FSG_LED_WLAN_BIT 0 | 26 | #define FSG_LED_WLAN_BIT 0 |
27 | #define FSG_LED_WAN_BIT 1 | 27 | #define FSG_LED_WAN_BIT 1 |
@@ -149,11 +149,10 @@ static int fsg_led_probe(struct platform_device *pdev) | |||
149 | int ret; | 149 | int ret; |
150 | 150 | ||
151 | /* Map the LED chip select address space */ | 151 | /* Map the LED chip select address space */ |
152 | latch_address = (unsigned short *) ioremap(IXP4XX_EXP_BUS_BASE(2), 512); | 152 | latch_address = (unsigned short *) devm_ioremap(&pdev->dev, |
153 | if (!latch_address) { | 153 | IXP4XX_EXP_BUS_BASE(2), 512); |
154 | ret = -ENOMEM; | 154 | if (!latch_address) |
155 | goto failremap; | 155 | return -ENOMEM; |
156 | } | ||
157 | 156 | ||
158 | latch_value = 0xffff; | 157 | latch_value = 0xffff; |
159 | *latch_address = latch_value; | 158 | *latch_address = latch_value; |
@@ -195,8 +194,6 @@ static int fsg_led_probe(struct platform_device *pdev) | |||
195 | failwan: | 194 | failwan: |
196 | led_classdev_unregister(&fsg_wlan_led); | 195 | led_classdev_unregister(&fsg_wlan_led); |
197 | failwlan: | 196 | failwlan: |
198 | iounmap(latch_address); | ||
199 | failremap: | ||
200 | 197 | ||
201 | return ret; | 198 | return ret; |
202 | } | 199 | } |
@@ -210,8 +207,6 @@ static int fsg_led_remove(struct platform_device *pdev) | |||
210 | led_classdev_unregister(&fsg_sync_led); | 207 | led_classdev_unregister(&fsg_sync_led); |
211 | led_classdev_unregister(&fsg_ring_led); | 208 | led_classdev_unregister(&fsg_ring_led); |
212 | 209 | ||
213 | iounmap(latch_address); | ||
214 | |||
215 | return 0; | 210 | return 0; |
216 | } | 211 | } |
217 | 212 | ||