diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:34 -0400 |
commit | 27c1ee3f929555b71fa39ec0d81a7e7185de1b16 (patch) | |
tree | 42e40bdfe4efac660d650658019391536ce67a42 /drivers/video | |
parent | 37cd9600a9e20359b0283983c9e3a55d84347168 (diff) | |
parent | 086ff4b3a7fb9cdf41e6a5d0ccd99b86d84633a1 (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge Andrew's first set of patches:
"Non-MM patches:
- lots of misc bits
- tree-wide have_clk() cleanups
- quite a lot of printk tweaks. I draw your attention to "printk:
convert the format for KERN_<LEVEL> to a 2 byte pattern" which
looks a bit scary. But afaict it's solid.
- backlight updates
- lib/ feature work (notably the addition and use of memweight())
- checkpatch updates
- rtc updates
- nilfs updates
- fatfs updates (partial, still waiting for acks)
- kdump, proc, fork, IPC, sysctl, taskstats, pps, etc
- new fault-injection feature work"
* Merge emailed patches from Andrew Morton <akpm@linux-foundation.org>: (128 commits)
drivers/misc/lkdtm.c: fix missing allocation failure check
lib/scatterlist: do not re-write gfp_flags in __sg_alloc_table()
fault-injection: add tool to run command with failslab or fail_page_alloc
fault-injection: add selftests for cpu and memory hotplug
powerpc: pSeries reconfig notifier error injection module
memory: memory notifier error injection module
PM: PM notifier error injection module
cpu: rewrite cpu-notifier-error-inject module
fault-injection: notifier error injection
c/r: fcntl: add F_GETOWNER_UIDS option
resource: make sure requested range is included in the root range
include/linux/aio.h: cpp->C conversions
fs: cachefiles: add support for large files in filesystem caching
pps: return PTR_ERR on error in device_create
taskstats: check nla_reserve() return
sysctl: suppress kmemleak messages
ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION
ipc: compat: use signed size_t types for msgsnd and msgrcv
ipc: allow compat IPC version field parsing if !ARCH_WANT_OLD_COMPAT_IPC
ipc: add COMPAT_SHMLBA support
...
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/atmel-pwm-bl.c | 19 | ||||
-rw-r--r-- | drivers/video/backlight/corgi_lcd.c | 19 | ||||
-rw-r--r-- | drivers/video/backlight/l4f00242t03.c | 29 | ||||
-rw-r--r-- | drivers/video/backlight/lm3533_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/lms283gf05.c | 24 | ||||
-rw-r--r-- | drivers/video/backlight/lp855x_bl.c | 10 | ||||
-rw-r--r-- | drivers/video/backlight/ot200_bl.c | 21 | ||||
-rw-r--r-- | drivers/video/backlight/tosa_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/tosa_lcd.c | 7 |
9 files changed, 48 insertions, 97 deletions
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index 0443a4f71858..df1cbb7ef6ca 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c | |||
@@ -127,7 +127,8 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
127 | struct atmel_pwm_bl *pwmbl; | 127 | struct atmel_pwm_bl *pwmbl; |
128 | int retval; | 128 | int retval; |
129 | 129 | ||
130 | pwmbl = kzalloc(sizeof(struct atmel_pwm_bl), GFP_KERNEL); | 130 | pwmbl = devm_kzalloc(&pdev->dev, sizeof(struct atmel_pwm_bl), |
131 | GFP_KERNEL); | ||
131 | if (!pwmbl) | 132 | if (!pwmbl) |
132 | return -ENOMEM; | 133 | return -ENOMEM; |
133 | 134 | ||
@@ -154,7 +155,8 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
154 | goto err_free_mem; | 155 | goto err_free_mem; |
155 | 156 | ||
156 | if (pwmbl->gpio_on != -1) { | 157 | if (pwmbl->gpio_on != -1) { |
157 | retval = gpio_request(pwmbl->gpio_on, "gpio_atmel_pwm_bl"); | 158 | retval = devm_gpio_request(&pdev->dev, pwmbl->gpio_on, |
159 | "gpio_atmel_pwm_bl"); | ||
158 | if (retval) { | 160 | if (retval) { |
159 | pwmbl->gpio_on = -1; | 161 | pwmbl->gpio_on = -1; |
160 | goto err_free_pwm; | 162 | goto err_free_pwm; |
@@ -164,7 +166,7 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
164 | retval = gpio_direction_output(pwmbl->gpio_on, | 166 | retval = gpio_direction_output(pwmbl->gpio_on, |
165 | 0 ^ pdata->on_active_low); | 167 | 0 ^ pdata->on_active_low); |
166 | if (retval) | 168 | if (retval) |
167 | goto err_free_gpio; | 169 | goto err_free_pwm; |
168 | } | 170 | } |
169 | 171 | ||
170 | memset(&props, 0, sizeof(struct backlight_properties)); | 172 | memset(&props, 0, sizeof(struct backlight_properties)); |
@@ -174,7 +176,7 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
174 | &atmel_pwm_bl_ops, &props); | 176 | &atmel_pwm_bl_ops, &props); |
175 | if (IS_ERR(bldev)) { | 177 | if (IS_ERR(bldev)) { |
176 | retval = PTR_ERR(bldev); | 178 | retval = PTR_ERR(bldev); |
177 | goto err_free_gpio; | 179 | goto err_free_pwm; |
178 | } | 180 | } |
179 | 181 | ||
180 | pwmbl->bldev = bldev; | 182 | pwmbl->bldev = bldev; |
@@ -196,13 +198,9 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
196 | err_free_bl_dev: | 198 | err_free_bl_dev: |
197 | platform_set_drvdata(pdev, NULL); | 199 | platform_set_drvdata(pdev, NULL); |
198 | backlight_device_unregister(bldev); | 200 | backlight_device_unregister(bldev); |
199 | err_free_gpio: | ||
200 | if (pwmbl->gpio_on != -1) | ||
201 | gpio_free(pwmbl->gpio_on); | ||
202 | err_free_pwm: | 201 | err_free_pwm: |
203 | pwm_channel_free(&pwmbl->pwmc); | 202 | pwm_channel_free(&pwmbl->pwmc); |
204 | err_free_mem: | 203 | err_free_mem: |
205 | kfree(pwmbl); | ||
206 | return retval; | 204 | return retval; |
207 | } | 205 | } |
208 | 206 | ||
@@ -210,15 +208,12 @@ static int __exit atmel_pwm_bl_remove(struct platform_device *pdev) | |||
210 | { | 208 | { |
211 | struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); | 209 | struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); |
212 | 210 | ||
213 | if (pwmbl->gpio_on != -1) { | 211 | if (pwmbl->gpio_on != -1) |
214 | gpio_set_value(pwmbl->gpio_on, 0); | 212 | gpio_set_value(pwmbl->gpio_on, 0); |
215 | gpio_free(pwmbl->gpio_on); | ||
216 | } | ||
217 | pwm_channel_disable(&pwmbl->pwmc); | 213 | pwm_channel_disable(&pwmbl->pwmc); |
218 | pwm_channel_free(&pwmbl->pwmc); | 214 | pwm_channel_free(&pwmbl->pwmc); |
219 | backlight_device_unregister(pwmbl->bldev); | 215 | backlight_device_unregister(pwmbl->bldev); |
220 | platform_set_drvdata(pdev, NULL); | 216 | platform_set_drvdata(pdev, NULL); |
221 | kfree(pwmbl); | ||
222 | 217 | ||
223 | return 0; | 218 | return 0; |
224 | } | 219 | } |
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index 23d732677ba1..c781768ba892 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c | |||
@@ -492,7 +492,8 @@ static int setup_gpio_backlight(struct corgi_lcd *lcd, | |||
492 | lcd->gpio_backlight_cont = -1; | 492 | lcd->gpio_backlight_cont = -1; |
493 | 493 | ||
494 | if (gpio_is_valid(pdata->gpio_backlight_on)) { | 494 | if (gpio_is_valid(pdata->gpio_backlight_on)) { |
495 | err = gpio_request(pdata->gpio_backlight_on, "BL_ON"); | 495 | err = devm_gpio_request(&spi->dev, pdata->gpio_backlight_on, |
496 | "BL_ON"); | ||
496 | if (err) { | 497 | if (err) { |
497 | dev_err(&spi->dev, "failed to request GPIO%d for " | 498 | dev_err(&spi->dev, "failed to request GPIO%d for " |
498 | "backlight_on\n", pdata->gpio_backlight_on); | 499 | "backlight_on\n", pdata->gpio_backlight_on); |
@@ -504,11 +505,12 @@ static int setup_gpio_backlight(struct corgi_lcd *lcd, | |||
504 | } | 505 | } |
505 | 506 | ||
506 | if (gpio_is_valid(pdata->gpio_backlight_cont)) { | 507 | if (gpio_is_valid(pdata->gpio_backlight_cont)) { |
507 | err = gpio_request(pdata->gpio_backlight_cont, "BL_CONT"); | 508 | err = devm_gpio_request(&spi->dev, pdata->gpio_backlight_cont, |
509 | "BL_CONT"); | ||
508 | if (err) { | 510 | if (err) { |
509 | dev_err(&spi->dev, "failed to request GPIO%d for " | 511 | dev_err(&spi->dev, "failed to request GPIO%d for " |
510 | "backlight_cont\n", pdata->gpio_backlight_cont); | 512 | "backlight_cont\n", pdata->gpio_backlight_cont); |
511 | goto err_free_backlight_on; | 513 | return err; |
512 | } | 514 | } |
513 | 515 | ||
514 | lcd->gpio_backlight_cont = pdata->gpio_backlight_cont; | 516 | lcd->gpio_backlight_cont = pdata->gpio_backlight_cont; |
@@ -525,11 +527,6 @@ static int setup_gpio_backlight(struct corgi_lcd *lcd, | |||
525 | } | 527 | } |
526 | } | 528 | } |
527 | return 0; | 529 | return 0; |
528 | |||
529 | err_free_backlight_on: | ||
530 | if (gpio_is_valid(lcd->gpio_backlight_on)) | ||
531 | gpio_free(lcd->gpio_backlight_on); | ||
532 | return err; | ||
533 | } | 530 | } |
534 | 531 | ||
535 | static int __devinit corgi_lcd_probe(struct spi_device *spi) | 532 | static int __devinit corgi_lcd_probe(struct spi_device *spi) |
@@ -602,12 +599,6 @@ static int __devexit corgi_lcd_remove(struct spi_device *spi) | |||
602 | backlight_update_status(lcd->bl_dev); | 599 | backlight_update_status(lcd->bl_dev); |
603 | backlight_device_unregister(lcd->bl_dev); | 600 | backlight_device_unregister(lcd->bl_dev); |
604 | 601 | ||
605 | if (gpio_is_valid(lcd->gpio_backlight_on)) | ||
606 | gpio_free(lcd->gpio_backlight_on); | ||
607 | |||
608 | if (gpio_is_valid(lcd->gpio_backlight_cont)) | ||
609 | gpio_free(lcd->gpio_backlight_cont); | ||
610 | |||
611 | corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN); | 602 | corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN); |
612 | lcd_device_unregister(lcd->lcd_dev); | 603 | lcd_device_unregister(lcd->lcd_dev); |
613 | 604 | ||
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index 40f606a86093..2d90c0648aa0 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c | |||
@@ -175,28 +175,27 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) | |||
175 | 175 | ||
176 | priv->spi = spi; | 176 | priv->spi = spi; |
177 | 177 | ||
178 | ret = gpio_request_one(pdata->reset_gpio, GPIOF_OUT_INIT_HIGH, | 178 | ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio, |
179 | "lcd l4f00242t03 reset"); | 179 | GPIOF_OUT_INIT_HIGH, "lcd l4f00242t03 reset"); |
180 | if (ret) { | 180 | if (ret) { |
181 | dev_err(&spi->dev, | 181 | dev_err(&spi->dev, |
182 | "Unable to get the lcd l4f00242t03 reset gpio.\n"); | 182 | "Unable to get the lcd l4f00242t03 reset gpio.\n"); |
183 | return ret; | 183 | return ret; |
184 | } | 184 | } |
185 | 185 | ||
186 | ret = gpio_request_one(pdata->data_enable_gpio, GPIOF_OUT_INIT_LOW, | 186 | ret = devm_gpio_request_one(&spi->dev, pdata->data_enable_gpio, |
187 | "lcd l4f00242t03 data enable"); | 187 | GPIOF_OUT_INIT_LOW, "lcd l4f00242t03 data enable"); |
188 | if (ret) { | 188 | if (ret) { |
189 | dev_err(&spi->dev, | 189 | dev_err(&spi->dev, |
190 | "Unable to get the lcd l4f00242t03 data en gpio.\n"); | 190 | "Unable to get the lcd l4f00242t03 data en gpio.\n"); |
191 | goto err; | 191 | return ret; |
192 | } | 192 | } |
193 | 193 | ||
194 | priv->io_reg = regulator_get(&spi->dev, "vdd"); | 194 | priv->io_reg = regulator_get(&spi->dev, "vdd"); |
195 | if (IS_ERR(priv->io_reg)) { | 195 | if (IS_ERR(priv->io_reg)) { |
196 | ret = PTR_ERR(priv->io_reg); | ||
197 | dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", | 196 | dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", |
198 | __func__); | 197 | __func__); |
199 | goto err2; | 198 | return PTR_ERR(priv->io_reg); |
200 | } | 199 | } |
201 | 200 | ||
202 | priv->core_reg = regulator_get(&spi->dev, "vcore"); | 201 | priv->core_reg = regulator_get(&spi->dev, "vcore"); |
@@ -204,14 +203,14 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) | |||
204 | ret = PTR_ERR(priv->core_reg); | 203 | ret = PTR_ERR(priv->core_reg); |
205 | dev_err(&spi->dev, "%s: Unable to get the core regulator\n", | 204 | dev_err(&spi->dev, "%s: Unable to get the core regulator\n", |
206 | __func__); | 205 | __func__); |
207 | goto err3; | 206 | goto err1; |
208 | } | 207 | } |
209 | 208 | ||
210 | priv->ld = lcd_device_register("l4f00242t03", | 209 | priv->ld = lcd_device_register("l4f00242t03", |
211 | &spi->dev, priv, &l4f_ops); | 210 | &spi->dev, priv, &l4f_ops); |
212 | if (IS_ERR(priv->ld)) { | 211 | if (IS_ERR(priv->ld)) { |
213 | ret = PTR_ERR(priv->ld); | 212 | ret = PTR_ERR(priv->ld); |
214 | goto err4; | 213 | goto err2; |
215 | } | 214 | } |
216 | 215 | ||
217 | /* Init the LCD */ | 216 | /* Init the LCD */ |
@@ -223,14 +222,10 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) | |||
223 | 222 | ||
224 | return 0; | 223 | return 0; |
225 | 224 | ||
226 | err4: | 225 | err2: |
227 | regulator_put(priv->core_reg); | 226 | regulator_put(priv->core_reg); |
228 | err3: | 227 | err1: |
229 | regulator_put(priv->io_reg); | 228 | regulator_put(priv->io_reg); |
230 | err2: | ||
231 | gpio_free(pdata->data_enable_gpio); | ||
232 | err: | ||
233 | gpio_free(pdata->reset_gpio); | ||
234 | 229 | ||
235 | return ret; | 230 | return ret; |
236 | } | 231 | } |
@@ -238,16 +233,12 @@ err: | |||
238 | static int __devexit l4f00242t03_remove(struct spi_device *spi) | 233 | static int __devexit l4f00242t03_remove(struct spi_device *spi) |
239 | { | 234 | { |
240 | struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); | 235 | struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); |
241 | struct l4f00242t03_pdata *pdata = priv->spi->dev.platform_data; | ||
242 | 236 | ||
243 | l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN); | 237 | l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN); |
244 | lcd_device_unregister(priv->ld); | 238 | lcd_device_unregister(priv->ld); |
245 | 239 | ||
246 | dev_set_drvdata(&spi->dev, NULL); | 240 | dev_set_drvdata(&spi->dev, NULL); |
247 | 241 | ||
248 | gpio_free(pdata->data_enable_gpio); | ||
249 | gpio_free(pdata->reset_gpio); | ||
250 | |||
251 | regulator_put(priv->io_reg); | 242 | regulator_put(priv->io_reg); |
252 | regulator_put(priv->core_reg); | 243 | regulator_put(priv->core_reg); |
253 | 244 | ||
diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c index bebeb63607db..18dca0c29c68 100644 --- a/drivers/video/backlight/lm3533_bl.c +++ b/drivers/video/backlight/lm3533_bl.c | |||
@@ -295,7 +295,7 @@ static int __devinit lm3533_bl_probe(struct platform_device *pdev) | |||
295 | return -EINVAL; | 295 | return -EINVAL; |
296 | } | 296 | } |
297 | 297 | ||
298 | bl = kzalloc(sizeof(*bl), GFP_KERNEL); | 298 | bl = devm_kzalloc(&pdev->dev, sizeof(*bl), GFP_KERNEL); |
299 | if (!bl) { | 299 | if (!bl) { |
300 | dev_err(&pdev->dev, | 300 | dev_err(&pdev->dev, |
301 | "failed to allocate memory for backlight\n"); | 301 | "failed to allocate memory for backlight\n"); |
@@ -317,8 +317,7 @@ static int __devinit lm3533_bl_probe(struct platform_device *pdev) | |||
317 | &lm3533_bl_ops, &props); | 317 | &lm3533_bl_ops, &props); |
318 | if (IS_ERR(bd)) { | 318 | if (IS_ERR(bd)) { |
319 | dev_err(&pdev->dev, "failed to register backlight device\n"); | 319 | dev_err(&pdev->dev, "failed to register backlight device\n"); |
320 | ret = PTR_ERR(bd); | 320 | return PTR_ERR(bd); |
321 | goto err_free; | ||
322 | } | 321 | } |
323 | 322 | ||
324 | bl->bd = bd; | 323 | bl->bd = bd; |
@@ -348,8 +347,6 @@ err_sysfs_remove: | |||
348 | sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); | 347 | sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); |
349 | err_unregister: | 348 | err_unregister: |
350 | backlight_device_unregister(bd); | 349 | backlight_device_unregister(bd); |
351 | err_free: | ||
352 | kfree(bl); | ||
353 | 350 | ||
354 | return ret; | 351 | return ret; |
355 | } | 352 | } |
@@ -367,7 +364,6 @@ static int __devexit lm3533_bl_remove(struct platform_device *pdev) | |||
367 | lm3533_ctrlbank_disable(&bl->cb); | 364 | lm3533_ctrlbank_disable(&bl->cb); |
368 | sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); | 365 | sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group); |
369 | backlight_device_unregister(bd); | 366 | backlight_device_unregister(bd); |
370 | kfree(bl); | ||
371 | 367 | ||
372 | return 0; | 368 | return 0; |
373 | } | 369 | } |
diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index a9f2c36966f1..ea43f2254196 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c | |||
@@ -158,29 +158,27 @@ static int __devinit lms283gf05_probe(struct spi_device *spi) | |||
158 | int ret = 0; | 158 | int ret = 0; |
159 | 159 | ||
160 | if (pdata != NULL) { | 160 | if (pdata != NULL) { |
161 | ret = gpio_request(pdata->reset_gpio, "LMS285GF05 RESET"); | 161 | ret = devm_gpio_request(&spi->dev, pdata->reset_gpio, |
162 | "LMS285GF05 RESET"); | ||
162 | if (ret) | 163 | if (ret) |
163 | return ret; | 164 | return ret; |
164 | 165 | ||
165 | ret = gpio_direction_output(pdata->reset_gpio, | 166 | ret = gpio_direction_output(pdata->reset_gpio, |
166 | !pdata->reset_inverted); | 167 | !pdata->reset_inverted); |
167 | if (ret) | 168 | if (ret) |
168 | goto err; | 169 | return ret; |
169 | } | 170 | } |
170 | 171 | ||
171 | st = devm_kzalloc(&spi->dev, sizeof(struct lms283gf05_state), | 172 | st = devm_kzalloc(&spi->dev, sizeof(struct lms283gf05_state), |
172 | GFP_KERNEL); | 173 | GFP_KERNEL); |
173 | if (st == NULL) { | 174 | if (st == NULL) { |
174 | dev_err(&spi->dev, "No memory for device state\n"); | 175 | dev_err(&spi->dev, "No memory for device state\n"); |
175 | ret = -ENOMEM; | 176 | return -ENOMEM; |
176 | goto err; | ||
177 | } | 177 | } |
178 | 178 | ||
179 | ld = lcd_device_register("lms283gf05", &spi->dev, st, &lms_ops); | 179 | ld = lcd_device_register("lms283gf05", &spi->dev, st, &lms_ops); |
180 | if (IS_ERR(ld)) { | 180 | if (IS_ERR(ld)) |
181 | ret = PTR_ERR(ld); | 181 | return PTR_ERR(ld); |
182 | goto err; | ||
183 | } | ||
184 | 182 | ||
185 | st->spi = spi; | 183 | st->spi = spi; |
186 | st->ld = ld; | 184 | st->ld = ld; |
@@ -193,24 +191,14 @@ static int __devinit lms283gf05_probe(struct spi_device *spi) | |||
193 | lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); | 191 | lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq)); |
194 | 192 | ||
195 | return 0; | 193 | return 0; |
196 | |||
197 | err: | ||
198 | if (pdata != NULL) | ||
199 | gpio_free(pdata->reset_gpio); | ||
200 | |||
201 | return ret; | ||
202 | } | 194 | } |
203 | 195 | ||
204 | static int __devexit lms283gf05_remove(struct spi_device *spi) | 196 | static int __devexit lms283gf05_remove(struct spi_device *spi) |
205 | { | 197 | { |
206 | struct lms283gf05_state *st = dev_get_drvdata(&spi->dev); | 198 | struct lms283gf05_state *st = dev_get_drvdata(&spi->dev); |
207 | struct lms283gf05_pdata *pdata = st->spi->dev.platform_data; | ||
208 | 199 | ||
209 | lcd_device_unregister(st->ld); | 200 | lcd_device_unregister(st->ld); |
210 | 201 | ||
211 | if (pdata != NULL) | ||
212 | gpio_free(pdata->reset_gpio); | ||
213 | |||
214 | return 0; | 202 | return 0; |
215 | } | 203 | } |
216 | 204 | ||
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index 72a0e0c917cf..aa6d4f71131f 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c | |||
@@ -14,11 +14,15 @@ | |||
14 | #include <linux/i2c.h> | 14 | #include <linux/i2c.h> |
15 | #include <linux/backlight.h> | 15 | #include <linux/backlight.h> |
16 | #include <linux/err.h> | 16 | #include <linux/err.h> |
17 | #include <linux/lp855x.h> | 17 | #include <linux/platform_data/lp855x.h> |
18 | 18 | ||
19 | /* Registers */ | 19 | /* Registers */ |
20 | #define BRIGHTNESS_CTRL (0x00) | 20 | #define BRIGHTNESS_CTRL 0x00 |
21 | #define DEVICE_CTRL (0x01) | 21 | #define DEVICE_CTRL 0x01 |
22 | #define EEPROM_START 0xA0 | ||
23 | #define EEPROM_END 0xA7 | ||
24 | #define EPROM_START 0xA0 | ||
25 | #define EPROM_END 0xAF | ||
22 | 26 | ||
23 | #define BUF_SIZE 20 | 27 | #define BUF_SIZE 20 |
24 | #define DEFAULT_BL_NAME "lcd-backlight" | 28 | #define DEFAULT_BL_NAME "lcd-backlight" |
diff --git a/drivers/video/backlight/ot200_bl.c b/drivers/video/backlight/ot200_bl.c index f519d55a294c..469cf0f109d2 100644 --- a/drivers/video/backlight/ot200_bl.c +++ b/drivers/video/backlight/ot200_bl.c | |||
@@ -84,7 +84,8 @@ static int ot200_backlight_probe(struct platform_device *pdev) | |||
84 | int retval = 0; | 84 | int retval = 0; |
85 | 85 | ||
86 | /* request gpio */ | 86 | /* request gpio */ |
87 | if (gpio_request(GPIO_DIMM, "ot200 backlight dimmer") < 0) { | 87 | if (devm_gpio_request(&pdev->dev, GPIO_DIMM, |
88 | "ot200 backlight dimmer") < 0) { | ||
88 | dev_err(&pdev->dev, "failed to request GPIO %d\n", GPIO_DIMM); | 89 | dev_err(&pdev->dev, "failed to request GPIO %d\n", GPIO_DIMM); |
89 | return -ENODEV; | 90 | return -ENODEV; |
90 | } | 91 | } |
@@ -93,14 +94,13 @@ static int ot200_backlight_probe(struct platform_device *pdev) | |||
93 | pwm_timer = cs5535_mfgpt_alloc_timer(7, MFGPT_DOMAIN_ANY); | 94 | pwm_timer = cs5535_mfgpt_alloc_timer(7, MFGPT_DOMAIN_ANY); |
94 | if (!pwm_timer) { | 95 | if (!pwm_timer) { |
95 | dev_err(&pdev->dev, "MFGPT 7 not available\n"); | 96 | dev_err(&pdev->dev, "MFGPT 7 not available\n"); |
96 | retval = -ENODEV; | 97 | return -ENODEV; |
97 | goto error_mfgpt_alloc; | ||
98 | } | 98 | } |
99 | 99 | ||
100 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 100 | data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); |
101 | if (!data) { | 101 | if (!data) { |
102 | retval = -ENOMEM; | 102 | retval = -ENOMEM; |
103 | goto error_kzalloc; | 103 | goto error_devm_kzalloc; |
104 | } | 104 | } |
105 | 105 | ||
106 | /* setup gpio */ | 106 | /* setup gpio */ |
@@ -122,26 +122,21 @@ static int ot200_backlight_probe(struct platform_device *pdev) | |||
122 | if (IS_ERR(bl)) { | 122 | if (IS_ERR(bl)) { |
123 | dev_err(&pdev->dev, "failed to register backlight\n"); | 123 | dev_err(&pdev->dev, "failed to register backlight\n"); |
124 | retval = PTR_ERR(bl); | 124 | retval = PTR_ERR(bl); |
125 | goto error_backlight_device_register; | 125 | goto error_devm_kzalloc; |
126 | } | 126 | } |
127 | 127 | ||
128 | platform_set_drvdata(pdev, bl); | 128 | platform_set_drvdata(pdev, bl); |
129 | 129 | ||
130 | return 0; | 130 | return 0; |
131 | 131 | ||
132 | error_backlight_device_register: | 132 | error_devm_kzalloc: |
133 | kfree(data); | ||
134 | error_kzalloc: | ||
135 | cs5535_mfgpt_free_timer(pwm_timer); | 133 | cs5535_mfgpt_free_timer(pwm_timer); |
136 | error_mfgpt_alloc: | ||
137 | gpio_free(GPIO_DIMM); | ||
138 | return retval; | 134 | return retval; |
139 | } | 135 | } |
140 | 136 | ||
141 | static int ot200_backlight_remove(struct platform_device *pdev) | 137 | static int ot200_backlight_remove(struct platform_device *pdev) |
142 | { | 138 | { |
143 | struct backlight_device *bl = platform_get_drvdata(pdev); | 139 | struct backlight_device *bl = platform_get_drvdata(pdev); |
144 | struct ot200_backlight_data *data = bl_get_data(bl); | ||
145 | 140 | ||
146 | backlight_device_unregister(bl); | 141 | backlight_device_unregister(bl); |
147 | 142 | ||
@@ -152,9 +147,7 @@ static int ot200_backlight_remove(struct platform_device *pdev) | |||
152 | MAX_COMP2 - dim_table[100]); | 147 | MAX_COMP2 - dim_table[100]); |
153 | 148 | ||
154 | cs5535_mfgpt_free_timer(pwm_timer); | 149 | cs5535_mfgpt_free_timer(pwm_timer); |
155 | gpio_free(GPIO_DIMM); | ||
156 | 150 | ||
157 | kfree(data); | ||
158 | return 0; | 151 | return 0; |
159 | } | 152 | } |
160 | 153 | ||
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 0d54e607e82d..49342e1d20be 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c | |||
@@ -92,14 +92,14 @@ static int __devinit tosa_bl_probe(struct i2c_client *client, | |||
92 | 92 | ||
93 | data->comadj = sharpsl_param.comadj == -1 ? COMADJ_DEFAULT : sharpsl_param.comadj; | 93 | data->comadj = sharpsl_param.comadj == -1 ? COMADJ_DEFAULT : sharpsl_param.comadj; |
94 | 94 | ||
95 | ret = gpio_request(TOSA_GPIO_BL_C20MA, "backlight"); | 95 | ret = devm_gpio_request(&client->dev, TOSA_GPIO_BL_C20MA, "backlight"); |
96 | if (ret) { | 96 | if (ret) { |
97 | dev_dbg(&data->bl->dev, "Unable to request gpio!\n"); | 97 | dev_dbg(&data->bl->dev, "Unable to request gpio!\n"); |
98 | return ret; | 98 | return ret; |
99 | } | 99 | } |
100 | ret = gpio_direction_output(TOSA_GPIO_BL_C20MA, 0); | 100 | ret = gpio_direction_output(TOSA_GPIO_BL_C20MA, 0); |
101 | if (ret) | 101 | if (ret) |
102 | goto err_gpio_dir; | 102 | return ret; |
103 | 103 | ||
104 | i2c_set_clientdata(client, data); | 104 | i2c_set_clientdata(client, data); |
105 | data->i2c = client; | 105 | data->i2c = client; |
@@ -123,8 +123,6 @@ static int __devinit tosa_bl_probe(struct i2c_client *client, | |||
123 | 123 | ||
124 | err_reg: | 124 | err_reg: |
125 | data->bl = NULL; | 125 | data->bl = NULL; |
126 | err_gpio_dir: | ||
127 | gpio_free(TOSA_GPIO_BL_C20MA); | ||
128 | return ret; | 126 | return ret; |
129 | } | 127 | } |
130 | 128 | ||
@@ -135,8 +133,6 @@ static int __devexit tosa_bl_remove(struct i2c_client *client) | |||
135 | backlight_device_unregister(data->bl); | 133 | backlight_device_unregister(data->bl); |
136 | data->bl = NULL; | 134 | data->bl = NULL; |
137 | 135 | ||
138 | gpio_free(TOSA_GPIO_BL_C20MA); | ||
139 | |||
140 | return 0; | 136 | return 0; |
141 | } | 137 | } |
142 | 138 | ||
diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index 47823b8efff0..33047a66cc24 100644 --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c | |||
@@ -193,7 +193,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
193 | data->spi = spi; | 193 | data->spi = spi; |
194 | dev_set_drvdata(&spi->dev, data); | 194 | dev_set_drvdata(&spi->dev, data); |
195 | 195 | ||
196 | ret = gpio_request(TOSA_GPIO_TG_ON, "tg #pwr"); | 196 | ret = devm_gpio_request(&spi->dev, TOSA_GPIO_TG_ON, "tg #pwr"); |
197 | if (ret < 0) | 197 | if (ret < 0) |
198 | goto err_gpio_tg; | 198 | goto err_gpio_tg; |
199 | 199 | ||
@@ -201,7 +201,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
201 | 201 | ||
202 | ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0); | 202 | ret = gpio_direction_output(TOSA_GPIO_TG_ON, 0); |
203 | if (ret < 0) | 203 | if (ret < 0) |
204 | goto err_gpio_dir; | 204 | goto err_gpio_tg; |
205 | 205 | ||
206 | mdelay(60); | 206 | mdelay(60); |
207 | tosa_lcd_tg_init(data); | 207 | tosa_lcd_tg_init(data); |
@@ -221,8 +221,6 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
221 | 221 | ||
222 | err_register: | 222 | err_register: |
223 | tosa_lcd_tg_off(data); | 223 | tosa_lcd_tg_off(data); |
224 | err_gpio_dir: | ||
225 | gpio_free(TOSA_GPIO_TG_ON); | ||
226 | err_gpio_tg: | 224 | err_gpio_tg: |
227 | dev_set_drvdata(&spi->dev, NULL); | 225 | dev_set_drvdata(&spi->dev, NULL); |
228 | return ret; | 226 | return ret; |
@@ -239,7 +237,6 @@ static int __devexit tosa_lcd_remove(struct spi_device *spi) | |||
239 | 237 | ||
240 | tosa_lcd_tg_off(data); | 238 | tosa_lcd_tg_off(data); |
241 | 239 | ||
242 | gpio_free(TOSA_GPIO_TG_ON); | ||
243 | dev_set_drvdata(&spi->dev, NULL); | 240 | dev_set_drvdata(&spi->dev, NULL); |
244 | 241 | ||
245 | return 0; | 242 | return 0; |