diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-12-17 19:00:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:16 -0500 |
commit | 2c114cb4edb741822ea48e80be8c525032206e9a (patch) | |
tree | 510bf0549f30c125df70c70af1d2a0c2fdb50adb /drivers/video/backlight | |
parent | 3a1f9462dbdf4d671f2f21290d507d1ae89d141a (diff) |
drivers/video/backlight/max8925_bl.c: drop devm_kfree of devm_kzalloc'd data
devm_kfree() allocates memory that is released when a driver detaches.
Thus, there is no reason to explicitly call devm_kfree in probe or remove
functions.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/max8925_bl.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index c6bec7aab87b..2c9bce050aa9 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c | |||
@@ -120,15 +120,13 @@ static int max8925_backlight_probe(struct platform_device *pdev) | |||
120 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); | 120 | res = platform_get_resource(pdev, IORESOURCE_REG, 0); |
121 | if (!res) { | 121 | if (!res) { |
122 | dev_err(&pdev->dev, "No REG resource for mode control!\n"); | 122 | dev_err(&pdev->dev, "No REG resource for mode control!\n"); |
123 | ret = -ENXIO; | 123 | return -ENXIO; |
124 | goto out; | ||
125 | } | 124 | } |
126 | data->reg_mode_cntl = res->start; | 125 | data->reg_mode_cntl = res->start; |
127 | res = platform_get_resource(pdev, IORESOURCE_REG, 1); | 126 | res = platform_get_resource(pdev, IORESOURCE_REG, 1); |
128 | if (!res) { | 127 | if (!res) { |
129 | dev_err(&pdev->dev, "No REG resource for control!\n"); | 128 | dev_err(&pdev->dev, "No REG resource for control!\n"); |
130 | ret = -ENXIO; | 129 | return -ENXIO; |
131 | goto out; | ||
132 | } | 130 | } |
133 | data->reg_cntl = res->start; | 131 | data->reg_cntl = res->start; |
134 | 132 | ||
@@ -142,8 +140,7 @@ static int max8925_backlight_probe(struct platform_device *pdev) | |||
142 | &max8925_backlight_ops, &props); | 140 | &max8925_backlight_ops, &props); |
143 | if (IS_ERR(bl)) { | 141 | if (IS_ERR(bl)) { |
144 | dev_err(&pdev->dev, "failed to register backlight\n"); | 142 | dev_err(&pdev->dev, "failed to register backlight\n"); |
145 | ret = PTR_ERR(bl); | 143 | return PTR_ERR(bl); |
146 | goto out; | ||
147 | } | 144 | } |
148 | bl->props.brightness = MAX_BRIGHTNESS; | 145 | bl->props.brightness = MAX_BRIGHTNESS; |
149 | 146 | ||
@@ -166,8 +163,6 @@ static int max8925_backlight_probe(struct platform_device *pdev) | |||
166 | return 0; | 163 | return 0; |
167 | out_brt: | 164 | out_brt: |
168 | backlight_device_unregister(bl); | 165 | backlight_device_unregister(bl); |
169 | out: | ||
170 | devm_kfree(&pdev->dev, data); | ||
171 | return ret; | 166 | return ret; |
172 | } | 167 | } |
173 | 168 | ||