diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-09-10 22:01:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-11 16:57:18 -0400 |
commit | 58efc77c86af5cb81d7d7ea0c3c3e675e7d121dc (patch) | |
tree | 16c8c67763b52fe8da8128f848a089b456363d81 /drivers/usb/renesas_usbhs | |
parent | 1cd572fc0c5f6887ea0542e2d3ec26625e2cdfb7 (diff) |
usb: renesas_usbhs: convert to devm_xxx()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 681da06170c2..072edc1cc55f 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c | |||
@@ -432,17 +432,16 @@ static int usbhs_probe(struct platform_device *pdev) | |||
432 | } | 432 | } |
433 | 433 | ||
434 | /* usb private data */ | 434 | /* usb private data */ |
435 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 435 | priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); |
436 | if (!priv) { | 436 | if (!priv) { |
437 | dev_err(&pdev->dev, "Could not allocate priv\n"); | 437 | dev_err(&pdev->dev, "Could not allocate priv\n"); |
438 | return -ENOMEM; | 438 | return -ENOMEM; |
439 | } | 439 | } |
440 | 440 | ||
441 | priv->base = ioremap_nocache(res->start, resource_size(res)); | 441 | priv->base = devm_request_and_ioremap(&pdev->dev, res); |
442 | if (!priv->base) { | 442 | if (!priv->base) { |
443 | dev_err(&pdev->dev, "ioremap error.\n"); | 443 | dev_err(&pdev->dev, "ioremap error.\n"); |
444 | ret = -ENOMEM; | 444 | return -ENOMEM; |
445 | goto probe_end_kfree; | ||
446 | } | 445 | } |
447 | 446 | ||
448 | /* | 447 | /* |
@@ -485,7 +484,7 @@ static int usbhs_probe(struct platform_device *pdev) | |||
485 | /* call pipe and module init */ | 484 | /* call pipe and module init */ |
486 | ret = usbhs_pipe_probe(priv); | 485 | ret = usbhs_pipe_probe(priv); |
487 | if (ret < 0) | 486 | if (ret < 0) |
488 | goto probe_end_iounmap; | 487 | return ret; |
489 | 488 | ||
490 | ret = usbhs_fifo_probe(priv); | 489 | ret = usbhs_fifo_probe(priv); |
491 | if (ret < 0) | 490 | if (ret < 0) |
@@ -546,10 +545,6 @@ probe_end_fifo_exit: | |||
546 | usbhs_fifo_remove(priv); | 545 | usbhs_fifo_remove(priv); |
547 | probe_end_pipe_exit: | 546 | probe_end_pipe_exit: |
548 | usbhs_pipe_remove(priv); | 547 | usbhs_pipe_remove(priv); |
549 | probe_end_iounmap: | ||
550 | iounmap(priv->base); | ||
551 | probe_end_kfree: | ||
552 | kfree(priv); | ||
553 | 548 | ||
554 | dev_info(&pdev->dev, "probe failed\n"); | 549 | dev_info(&pdev->dev, "probe failed\n"); |
555 | 550 | ||
@@ -576,8 +571,6 @@ static int __devexit usbhs_remove(struct platform_device *pdev) | |||
576 | usbhs_mod_remove(priv); | 571 | usbhs_mod_remove(priv); |
577 | usbhs_fifo_remove(priv); | 572 | usbhs_fifo_remove(priv); |
578 | usbhs_pipe_remove(priv); | 573 | usbhs_pipe_remove(priv); |
579 | iounmap(priv->base); | ||
580 | kfree(priv); | ||
581 | 574 | ||
582 | return 0; | 575 | return 0; |
583 | } | 576 | } |