aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpio/gpio-cs5535.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-cs5535.c b/drivers/gpio/gpio-cs5535.c
index 668127fe90ef..71484eeb4ac2 100644
--- a/drivers/gpio/gpio-cs5535.c
+++ b/drivers/gpio/gpio-cs5535.c
@@ -322,7 +322,8 @@ static int cs5535_gpio_probe(struct platform_device *pdev)
322 goto done; 322 goto done;
323 } 323 }
324 324
325 if (!request_region(res->start, resource_size(res), pdev->name)) { 325 if (!devm_request_region(&pdev->dev, res->start, resource_size(res),
326 pdev->name)) {
326 dev_err(&pdev->dev, "can't request region\n"); 327 dev_err(&pdev->dev, "can't request region\n");
327 goto done; 328 goto done;
328 } 329 }
@@ -348,24 +349,18 @@ static int cs5535_gpio_probe(struct platform_device *pdev)
348 /* finally, register with the generic GPIO API */ 349 /* finally, register with the generic GPIO API */
349 err = gpiochip_add(&cs5535_gpio_chip.chip); 350 err = gpiochip_add(&cs5535_gpio_chip.chip);
350 if (err) 351 if (err)
351 goto release_region; 352 goto done;
352 353
353 return 0; 354 return 0;
354 355
355release_region:
356 release_region(res->start, resource_size(res));
357done: 356done:
358 return err; 357 return err;
359} 358}
360 359
361static int cs5535_gpio_remove(struct platform_device *pdev) 360static int cs5535_gpio_remove(struct platform_device *pdev)
362{ 361{
363 struct resource *r;
364
365 gpiochip_remove(&cs5535_gpio_chip.chip); 362 gpiochip_remove(&cs5535_gpio_chip.chip);
366 363
367 r = platform_get_resource(pdev, IORESOURCE_IO, 0);
368 release_region(r->start, resource_size(r));
369 return 0; 364 return 0;
370} 365}
371 366