From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
<linux-usb@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
Eddie Hung <eddie.hung@mediatek.com>
Subject: [PATCH 5/5] usb: mtu3: skip getting extcon when use manual drd switch
Date: Fri, 28 May 2021 14:11:00 +0800 [thread overview]
Message-ID: <1622182260-23767-5-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1622182260-23767-1-git-send-email-chunfeng.yun@mediatek.com>
When use manual drd switch, extcon is not used in fact, so no
need get it even it exists, just skip it like using role switch.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/mtu3/mtu3_plat.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index eaeda391693a..bbfabdc1e79b 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -299,7 +299,10 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
of_property_read_bool(node, "enable-manual-drd");
otg_sx->role_sw_used = of_property_read_bool(node, "usb-role-switch");
- if (!otg_sx->role_sw_used && of_property_read_bool(node, "extcon")) {
+ if (otg_sx->role_sw_used || otg_sx->manual_drd_enabled)
+ goto out;
+
+ if (of_property_read_bool(node, "extcon")) {
otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0);
if (IS_ERR(otg_sx->edev)) {
return dev_err_probe(dev, PTR_ERR(otg_sx->edev),
--
2.18.0
prev parent reply other threads:[~2021-05-28 6:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 6:10 [PATCH 1/5] usb: mtu3: remove mtu3_ep0_setup() declaration in mtu3.h Chunfeng Yun
2021-05-28 6:10 ` [PATCH 2/5] usb: mtu3: remove repeated setting of speed Chunfeng Yun
2021-05-28 6:10 ` [PATCH 3/5] usb: mtu3: dump a status register of IPPC Chunfeng Yun
2021-05-28 6:10 ` [PATCH 4/5] usb: mtu3: use dev_err_probe to print error log about extcon Chunfeng Yun
2021-05-28 6:11 ` Chunfeng Yun [this message]
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=1622182260-23767-5-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=eddie.hung@mediatek.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 read-only IMAP folder(s) and NNTP newsgroup(s).