From: chunfeng.yun@mediatek.com (Chunfeng Yun)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/6] usb: mtu3: get resources that cause deferred probe earlier
Date: Mon, 6 Feb 2017 17:28:56 +0800 [thread overview]
Message-ID: <1486373341-4399-1-git-send-email-chunfeng.yun@mediatek.com> (raw)
Some resources such as regulator, clock usually cause deferred
probe, get them earlier to avoid more ineffective processing.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/mtu3/mtu3_plat.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 7833678..6344859 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -204,6 +204,18 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
int i;
int ret;
+ ssusb->vusb33 = devm_regulator_get(&pdev->dev, "vusb33");
+ if (IS_ERR(ssusb->vusb33)) {
+ dev_err(dev, "failed to get vusb33\n");
+ return PTR_ERR(ssusb->vusb33);
+ }
+
+ ssusb->sys_clk = devm_clk_get(dev, "sys_ck");
+ if (IS_ERR(ssusb->sys_clk)) {
+ dev_err(dev, "failed to get sys clock\n");
+ return PTR_ERR(ssusb->sys_clk);
+ }
+
ssusb->num_phys = of_count_phandle_with_args(node,
"phys", "#phy-cells");
if (ssusb->num_phys > 0) {
@@ -230,18 +242,6 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
return PTR_ERR(ssusb->ippc_base);
}
- ssusb->vusb33 = devm_regulator_get(&pdev->dev, "vusb33");
- if (IS_ERR(ssusb->vusb33)) {
- dev_err(dev, "failed to get vusb33\n");
- return PTR_ERR(ssusb->vusb33);
- }
-
- ssusb->sys_clk = devm_clk_get(dev, "sys_ck");
- if (IS_ERR(ssusb->sys_clk)) {
- dev_err(dev, "failed to get sys clock\n");
- return PTR_ERR(ssusb->sys_clk);
- }
-
ssusb->dr_mode = usb_get_dr_mode(dev);
if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN) {
dev_err(dev, "dr_mode is error\n");
--
1.7.9.5
next reply other threads:[~2017-02-06 9:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-06 9:28 Chunfeng Yun [this message]
2017-02-06 9:28 ` [PATCH v2 2/6] usb: mtu3: add reference clock Chunfeng Yun
2017-02-06 9:28 ` [PATCH v2 3/6] usb: xhci-mtk: " Chunfeng Yun
2017-02-06 9:28 ` [PATCH v2 4/6] arm64: dts: mt8173: add reference clock for usb Chunfeng Yun
2017-02-06 9:29 ` [PATCH v2 5/6] dt-bindings: mt8173-xhci: add reference clock Chunfeng Yun
2017-02-06 9:29 ` [PATCH v2 6/6] dt-bindings: mt8173-mtu3: " Chunfeng Yun
2017-02-07 6:03 ` Chunfeng Yun
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=1486373341-4399-1-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.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