diff mbox series

[3/3] usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host()

Message ID 20231214112622.2412321-3-xu.yang_2@nxp.com (mailing list archive)
State New, archived
Headers show
Series [1/3] usb: chipidea: ci_hdrc_imx: add wakeup clock and keep it always on | expand

Commit Message

Xu Yang Dec. 14, 2023, 11:26 a.m. UTC
When CONFIG_USB_OTG is not set, mxs_phy_is_otg_host() will always return
false. This behaviour is wrong. Since phy.last_event will always be set
for either host or device mode. Therefore, CONFIG_USB_OTG condition
can be removed.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
 drivers/usb/phy/phy-mxs-usb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Fabio Estevam Dec. 14, 2023, 11:25 a.m. UTC | #1
On Thu, Dec 14, 2023 at 8:20 AM Xu Yang <xu.yang_2@nxp.com> wrote:
>
> When CONFIG_USB_OTG is not set, mxs_phy_is_otg_host() will always return
> false. This behaviour is wrong. Since phy.last_event will always be set
> for either host or device mode. Therefore, CONFIG_USB_OTG condition
> can be removed.
>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Fixes tag?
Xu Yang Dec. 14, 2023, 12:35 p.m. UTC | #2
Hi Fabio,

> 
> On Thu, Dec 14, 2023 at 8:20 AM Xu Yang <xu.yang_2@nxp.com> wrote:
> >
> > When CONFIG_USB_OTG is not set, mxs_phy_is_otg_host() will always return
> > false. This behaviour is wrong. Since phy.last_event will always be set
> > for either host or device mode. Therefore, CONFIG_USB_OTG condition
> > can be removed.
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> 
> Fixes tag?

Sorry, will add tag in v2.
diff mbox series

Patch

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index acd46b72899e..920a32cd094d 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -388,8 +388,7 @@  static void __mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool disconnect)
 
 static bool mxs_phy_is_otg_host(struct mxs_phy *mxs_phy)
 {
-	return IS_ENABLED(CONFIG_USB_OTG) &&
-		mxs_phy->phy.last_event == USB_EVENT_ID;
+	return mxs_phy->phy.last_event == USB_EVENT_ID;
 }
 
 static void mxs_phy_disconnect_line(struct mxs_phy *mxs_phy, bool on)