All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: musb: Remove unnecessary check of musb->hcd in musb_handle_intr_connect()
@ 2019-12-17  9:50 Jia-Ju Bai
  2019-12-17  9:59 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Jia-Ju Bai @ 2019-12-17  9:50 UTC (permalink / raw)
  To: b-liu, gregkh; +Cc: linux-usb, linux-kernel, Jia-Ju Bai

In musb_handle_intr_connect(), musb->hcd should be non-null, 
so the check of musb->hcd on line 783 could be dropped.

Thank Greg for good advice.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
---
 drivers/usb/musb/musb_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 15cca912c53e..ce57f253a8e1 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -780,8 +780,7 @@ static void musb_handle_intr_connect(struct musb *musb, u8 devctl, u8 int_usb)
 		musb_dbg(musb, "HNP: CONNECT, now b_host");
 b_host:
 		musb->xceiv->otg->state = OTG_STATE_B_HOST;
-		if (musb->hcd)
-			musb->hcd->self.is_b_host = 1;
+		musb->hcd->self.is_b_host = 1;
 		del_timer(&musb->otg_timer);
 		break;
 	default:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-17 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17  9:50 [PATCH] usb: musb: Remove unnecessary check of musb->hcd in musb_handle_intr_connect() Jia-Ju Bai
2019-12-17  9:59 ` Greg KH
2019-12-17 12:27   ` Jia-Ju Bai
2019-12-17 19:15     ` Bin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.