diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-02-20 04:29:30 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-08 11:25:25 -0400 |
commit | 71f4b9cdfccfb82cff702fe61f4ace97a1dfb0e0 (patch) | |
tree | aacb9ffffeff7ffe47702034a4784b63830e6fc2 /drivers/mfd | |
parent | 54d34920ff6cefab0aa404fef841f9e6d3b6b9a1 (diff) |
mfd: omap-usb-host: Use devm_gpio_request_one()
Use devm_gpio_request_one() to make cleanup paths more simple.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/omap-usb-host.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 4febc5c7fdee..35a96e768db0 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
@@ -437,11 +437,11 @@ static void omap_usbhs_init(struct device *dev) | |||
437 | 437 | ||
438 | if (pdata->phy_reset) { | 438 | if (pdata->phy_reset) { |
439 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | 439 | if (gpio_is_valid(pdata->reset_gpio_port[0])) |
440 | gpio_request_one(pdata->reset_gpio_port[0], | 440 | devm_gpio_request_one(dev, pdata->reset_gpio_port[0], |
441 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); | 441 | GPIOF_OUT_INIT_LOW, "USB1 PHY reset"); |
442 | 442 | ||
443 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | 443 | if (gpio_is_valid(pdata->reset_gpio_port[1])) |
444 | gpio_request_one(pdata->reset_gpio_port[1], | 444 | devm_gpio_request_one(dev, pdata->reset_gpio_port[1], |
445 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); | 445 | GPIOF_OUT_INIT_LOW, "USB2 PHY reset"); |
446 | 446 | ||
447 | /* Hold the PHY in RESET for enough time till DIR is high */ | 447 | /* Hold the PHY in RESET for enough time till DIR is high */ |
@@ -492,21 +492,6 @@ static void omap_usbhs_init(struct device *dev) | |||
492 | } | 492 | } |
493 | } | 493 | } |
494 | 494 | ||
495 | static void omap_usbhs_deinit(struct device *dev) | ||
496 | { | ||
497 | struct usbhs_hcd_omap *omap = dev_get_drvdata(dev); | ||
498 | struct usbhs_omap_platform_data *pdata = omap->pdata; | ||
499 | |||
500 | if (pdata->phy_reset) { | ||
501 | if (gpio_is_valid(pdata->reset_gpio_port[0])) | ||
502 | gpio_free(pdata->reset_gpio_port[0]); | ||
503 | |||
504 | if (gpio_is_valid(pdata->reset_gpio_port[1])) | ||
505 | gpio_free(pdata->reset_gpio_port[1]); | ||
506 | } | ||
507 | } | ||
508 | |||
509 | |||
510 | /** | 495 | /** |
511 | * usbhs_omap_probe - initialize TI-based HCDs | 496 | * usbhs_omap_probe - initialize TI-based HCDs |
512 | * | 497 | * |
@@ -709,8 +694,6 @@ static int usbhs_omap_probe(struct platform_device *pdev) | |||
709 | return 0; | 694 | return 0; |
710 | 695 | ||
711 | err_alloc: | 696 | err_alloc: |
712 | omap_usbhs_deinit(&pdev->dev); | ||
713 | |||
714 | for (i = 0; i < omap->nports; i++) { | 697 | for (i = 0; i < omap->nports; i++) { |
715 | if (!IS_ERR(omap->utmi_clk[i])) | 698 | if (!IS_ERR(omap->utmi_clk[i])) |
716 | clk_put(omap->utmi_clk[i]); | 699 | clk_put(omap->utmi_clk[i]); |
@@ -755,8 +738,6 @@ static int usbhs_omap_remove(struct platform_device *pdev) | |||
755 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); | 738 | struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev); |
756 | int i; | 739 | int i; |
757 | 740 | ||
758 | omap_usbhs_deinit(&pdev->dev); | ||
759 | |||
760 | for (i = 0; i < omap->nports; i++) { | 741 | for (i = 0; i < omap->nports; i++) { |
761 | if (!IS_ERR(omap->utmi_clk[i])) | 742 | if (!IS_ERR(omap->utmi_clk[i])) |
762 | clk_put(omap->utmi_clk[i]); | 743 | clk_put(omap->utmi_clk[i]); |