From: Amelie Delaunay <amelie.delaunay@st.com>
To: Minas Harutyunyan <hminas@synopsys.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh+dt@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@st.com>
Cc: <linux-usb@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
Fabrice Gasnier <fabrice.gasnier@st.com>,
Amelie Delaunay <amelie.delaunay@st.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Subject: [PATCH 2/4] usb: dwc2: fix build issue when config is USB_DWC2_HOST only
Date: Fri, 24 Jul 2020 14:37:46 +0200 [thread overview]
Message-ID: <20200724123748.25369-3-amelie.delaunay@st.com> (raw)
In-Reply-To: <20200724123748.25369-1-amelie.delaunay@st.com>
This patch add missing definition of dwc2_hsotg_core_disconnect and
check configuration before using hsotg->test_mode, to fix build issue when
config USB_DWC2_PERIPHERAL or USB_DWC2_DUAL_ROLE are not set.
Fixes: bc0f0d4a5853 ("usb: dwc2: override PHY input signals with usb role switch support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
drivers/usb/dwc2/core.h | 1 +
drivers/usb/dwc2/drd.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index 33e790ccefb3..7161344c6522 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -1425,6 +1425,7 @@ static inline int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
{ return 0; }
static inline void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *dwc2,
bool reset) {}
+static inline void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg) {}
static inline void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg) {}
static inline void dwc2_hsotg_disconnect(struct dwc2_hsotg *dwc2) {}
static inline int dwc2_hsotg_set_test_mode(struct dwc2_hsotg *hsotg,
diff --git a/drivers/usb/dwc2/drd.c b/drivers/usb/dwc2/drd.c
index 032efffa37ab..5099841b1417 100644
--- a/drivers/usb/dwc2/drd.c
+++ b/drivers/usb/dwc2/drd.c
@@ -76,11 +76,14 @@ static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role)
(role == USB_ROLE_HOST && hsotg->dr_mode == USB_DR_MODE_PERIPHERAL))
return -EINVAL;
+#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
+ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
/* Skip session if core is in test mode */
if (role == USB_ROLE_NONE && hsotg->test_mode) {
dev_dbg(hsotg->dev, "Core is in test mode\n");
return -EBUSY;
}
+#endif
spin_lock_irqsave(&hsotg->lock, flags);
--
2.17.1
next prev parent reply other threads:[~2020-07-24 12:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-24 12:37 [PATCH 0/4] Fix DWC2 USB role switch support Amelie Delaunay
2020-07-24 12:37 ` [PATCH 1/4] dt-bindings: usb: dwc2: add optional usb-role-switch property Amelie Delaunay
2020-07-24 12:37 ` Amelie Delaunay [this message]
2020-07-24 12:37 ` [PATCH 3/4] usb: dwc2: drd: fix sleeping while spinlock atomic context Amelie Delaunay
2020-07-24 12:37 ` [PATCH 4/4] usb: dwc2: fix error path with missing dwc2_drd_exit Amelie Delaunay
2020-07-27 9:39 ` [PATCH 0/4] Fix DWC2 USB role switch support Amelie DELAUNAY
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=20200724123748.25369-3-amelie.delaunay@st.com \
--to=amelie.delaunay@st.com \
--cc=alexandre.torgue@st.com \
--cc=balbi@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fabrice.gasnier@st.com \
--cc=gregkh@linuxfoundation.org \
--cc=hminas@synopsys.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-usb@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=robh+dt@kernel.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
all inboxes | Powered by JetHome®