From: peter.chen@freescale.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v11 8/9] usb: chipidea: imx: add getting vbus regulator code
Date: Wed, 6 Mar 2013 17:56:39 +0800 [thread overview]
Message-ID: <1362563800-16673-9-git-send-email-peter.chen@freescale.com> (raw)
In-Reply-To: <1362563800-16673-1-git-send-email-peter.chen@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
---
drivers/usb/chipidea/ci13xxx_imx.c | 28 +++++-----------------------
1 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 3ed119e..b2d8350 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -33,7 +33,6 @@ struct ci13xxx_imx_data {
struct usb_phy *phy;
struct platform_device *ci_pdev;
struct clk *clk;
- struct regulator *reg_vbus;
};
static const struct usbmisc_ops *usbmisc_ops;
@@ -163,20 +162,9 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
data->phy = phy;
}
- /* we only support host now, so enable vbus here */
reg_vbus = devm_regulator_get(&pdev->dev, "vbus");
- if (!IS_ERR(reg_vbus)) {
- ret = regulator_enable(reg_vbus);
- if (ret) {
- dev_err(&pdev->dev,
- "Failed to enable vbus regulator, err=%d\n",
- ret);
- goto err_clk;
- }
- data->reg_vbus = reg_vbus;
- } else {
- reg_vbus = NULL;
- }
+ if (!IS_ERR(reg_vbus))
+ pdata->reg_vbus = reg_vbus;
pdata->phy = data->phy;
@@ -186,7 +174,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
if (!pdev->dev.dma_mask) {
ret = -ENOMEM;
dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
- goto err;
+ goto err_clk;
}
*pdev->dev.dma_mask = DMA_BIT_MASK(32);
dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);
@@ -197,7 +185,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev,
"usbmisc init failed, ret=%d\n", ret);
- goto err;
+ goto err_clk;
}
}
@@ -209,7 +197,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"Can't register ci_hdrc platform device, err=%d\n",
ret);
- goto err;
+ goto err_clk;
}
data->ci_pdev = plat_ci;
@@ -220,9 +208,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
return 0;
-err:
- if (reg_vbus)
- regulator_disable(reg_vbus);
err_clk:
clk_disable_unprepare(data->clk);
return ret;
@@ -235,9 +220,6 @@ static int ci13xxx_imx_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
ci13xxx_remove_device(data->ci_pdev);
- if (data->reg_vbus)
- regulator_disable(data->reg_vbus);
-
if (data->phy) {
usb_phy_shutdown(data->phy);
module_put(data->phy->dev->driver->owner);
--
1.7.0.4
next prev parent reply other threads:[~2013-03-06 9:56 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 9:56 [PATCH v11 0/9] Add tested id switch and vbus connect detect support for Chipidea Peter Chen
2013-03-06 9:56 ` [PATCH v11 1/9] Revert "USB: chipidea: add vbus detect for udc" Peter Chen
2013-03-06 9:56 ` [PATCH v11 2/9] usb: chipidea: add otg file Peter Chen
2013-03-06 9:56 ` [PATCH v11 3/9] usb: chipidea: add otg id switch and vbus connect/disconnect detect Peter Chen
2013-03-06 17:09 ` Alexander Shishkin
2013-03-07 5:50 ` Peter Chen
2013-03-08 12:42 ` Peter Chen
2013-03-06 9:56 ` [PATCH v11 4/9] usb: chipidea: udc: add pullup/pulldown dp at hw_device_state Peter Chen
2013-03-06 11:26 ` Felipe Balbi
2013-03-07 2:36 ` Peter Chen
2013-03-07 9:50 ` Felipe Balbi
2013-03-08 1:28 ` Peter Chen
2013-03-08 7:18 ` Felipe Balbi
2013-03-08 8:05 ` Peter Chen
2013-03-06 9:56 ` [PATCH v11 5/9] usb: chipidea: udc: retire the flag CI13_PULLUP_ON_VBUS Peter Chen
2013-03-06 9:56 ` [PATCH v11 6/9] usb: chipidea: add vbus regulator control Peter Chen
2013-03-06 11:29 ` Felipe Balbi
2013-03-07 2:41 ` Peter Chen
2013-03-07 9:52 ` Felipe Balbi
2013-03-08 6:27 ` Peter Chen
2013-03-08 7:26 ` Felipe Balbi
2013-03-08 8:32 ` Peter Chen
2013-03-08 8:42 ` Felipe Balbi
2013-03-08 8:52 ` Peter Chen
2013-03-08 8:58 ` Felipe Balbi
2013-03-06 9:56 ` [PATCH v11 7/9] usb: chipidea: delete the delayed work Peter Chen
2013-03-06 9:56 ` Peter Chen [this message]
2013-03-06 10:11 ` [PATCH v11 8/9] usb: chipidea: imx: add getting vbus regulator code Felipe Balbi
2013-03-07 2:18 ` Peter Chen
2013-03-06 9:56 ` [PATCH v11 9/9] usb: chipidea: udc: fix the oops when plugs in usb cable after rmmod gadget Peter Chen
2013-03-06 18:46 ` Russell King - ARM Linux
2013-03-07 2:48 ` Peter Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362563800-16673-9-git-send-email-peter.chen@freescale.com \
--to=peter.chen@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).