From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <felipe.balbi@linux.intel.com>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: [PATCH 04/11] usb: mtu3: rebuild the code of getting vbus regulator
Date: Wed, 6 Mar 2019 19:46:16 +0800 [thread overview]
Message-ID: <1551872783-13707-5-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1551872783-13707-1-git-send-email-chunfeng.yun@mediatek.com>
Remove local variable @vbus and use @dev instead of @pdev->dev
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/mtu3/mtu3_plat.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 3a4a80f15957..a326b1d6006a 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -228,7 +228,6 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
struct device_node *node = pdev->dev.of_node;
struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
struct device *dev = &pdev->dev;
- struct regulator *vbus;
struct resource *res;
int i;
int ret;
@@ -299,12 +298,11 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
of_property_read_u32(node, "mediatek,u3p-dis-msk",
&ssusb->u3p_dis_msk);
- vbus = devm_regulator_get(&pdev->dev, "vbus");
- if (IS_ERR(vbus)) {
+ otg_sx->vbus = devm_regulator_get(dev, "vbus");
+ if (IS_ERR(otg_sx->vbus)) {
dev_err(dev, "failed to get vbus\n");
- return PTR_ERR(vbus);
+ return PTR_ERR(otg_sx->vbus);
}
- otg_sx->vbus = vbus;
if (ssusb->dr_mode == USB_DR_MODE_HOST)
goto out;
--
2.20.1
next prev parent reply other threads:[~2019-03-06 11:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 11:46 [PATCH 00/11] add debugfs consumers, tracepoints and rebuild QMU Chunfeng Yun
2019-03-06 11:46 ` [PATCH 01/11] usb: mtu3: check return value of devm_extcon_register_notifier() Chunfeng Yun
2019-03-06 11:46 ` [PATCH 02/11] usb: mtu3: print useful information also for device and host modes Chunfeng Yun
2019-03-06 11:46 ` [PATCH 03/11] usb: mtu3: remove unnecessary local variable @req Chunfeng Yun
2019-03-06 11:46 ` Chunfeng Yun [this message]
2019-03-06 11:46 ` [PATCH 05/11] usb: mtu3: fix transfer error of USB3 Gen2 isoc Chunfeng Yun
2019-03-06 11:46 ` [PATCH 06/11] usb: mtu3: rebuild qmu_gpd struct to prepare to support new QMU format Chunfeng Yun
2019-03-06 11:46 ` [PATCH 07/11] usb: mtu3: supports " Chunfeng Yun
2019-03-06 11:46 ` [PATCH 08/11] usb: mtu3: add debugfs interface files Chunfeng Yun
2019-03-06 11:46 ` [PATCH 09/11] usb: mtu3: move vbus and mode debugfs interfaces into mtu3_debugfs.c Chunfeng Yun
2019-03-06 11:46 ` [PATCH 10/11] usb: mtu3: add tracepoints to help debug Chunfeng Yun
2019-03-06 11:46 ` [PATCH 11/11] usb: mtu3: add a function to switch mailbox state to string 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=1551872783-13707-5-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
/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).