diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-10-23 12:19:41 (GMT) |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2012-11-26 22:28:45 (GMT) |
commit | aa2dcf9dc150d4d077d8fa4a19f6e05196e9b9a5 (patch) | |
tree | 041dda65331b8577b447f3f70e96c6703c4ebc3c | |
parent | b0053aaa23907cb3e10e6d13923b9afd735c7272 (diff) | |
download | linux-fsl-qoriq-aa2dcf9dc150d4d077d8fa4a19f6e05196e9b9a5.tar.xz |
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>
-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 b9053fa..b4d5a44 100644 --- a/drivers/leds/leds-fsg.c +++ b/drivers/leds/leds-fsg.c @@ -20,8 +20,8 @@ #include <linux/platform_device.h> #include <linux/leds.h> #include <linux/module.h> +#include <linux/io.h> #include <mach/hardware.h> -#include <asm/io.h> #define FSG_LED_WLAN_BIT 0 #define FSG_LED_WAN_BIT 1 @@ -149,11 +149,10 @@ static int fsg_led_probe(struct platform_device *pdev) int ret; /* Map the LED chip select address space */ - latch_address = (unsigned short *) ioremap(IXP4XX_EXP_BUS_BASE(2), 512); - if (!latch_address) { - ret = -ENOMEM; - goto failremap; - } + latch_address = (unsigned short *) devm_ioremap(&pdev->dev, + IXP4XX_EXP_BUS_BASE(2), 512); + if (!latch_address) + return -ENOMEM; latch_value = 0xffff; *latch_address = latch_value; @@ -195,8 +194,6 @@ static int fsg_led_probe(struct platform_device *pdev) failwan: led_classdev_unregister(&fsg_wlan_led); failwlan: - iounmap(latch_address); - failremap: return ret; } @@ -210,8 +207,6 @@ static int fsg_led_remove(struct platform_device *pdev) led_classdev_unregister(&fsg_sync_led); led_classdev_unregister(&fsg_ring_led); - iounmap(latch_address); - return 0; } |