Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: phy: fsl-usb: use NULL instead of plain integer 0
@ 2026-11-28  1:58 Felix Huang via B4 Relay
  2026-11-28  1:59 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Huang via B4 Relay @ 2026-11-28  1:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linuxppc-dev, Felix Huang

From: Felix Huang <akafelixab@gmail.com>

Fix the following sparse warning in fsl_otg_set_peripheral():

  drivers/usb/phy/phy-fsl-usb.c:618:31: warning: Using plain integer as NULL pointer

Assign NULL instead of 0 to the struct usb_gadget pointer otg->gadget.

Signed-off-by: Felix Huang <akafelixab@gmail.com>
---
 drivers/usb/phy/phy-fsl-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 1986f7e9d..110b277aa 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -615,7 +615,7 @@ static int fsl_otg_set_peripheral(struct usb_otg *otg,
 		if (!otg->default_a)
 			otg->gadget->ops->vbus_draw(otg->gadget, 0);
 		usb_gadget_vbus_disconnect(otg->gadget);
-		otg->gadget = 0;
+		otg->gadget = NULL;
 		otg_dev->fsm.b_bus_req = 0;
 		otg_statemachine(&otg_dev->fsm);
 		return 0;

---
base-commit: f4585067150b85e33f60876149a6e742928da75e
change-id: 20261127-fsl-usb-null-pointer-fbb14806a3b0

Best regards,
--  
Felix Huang <akafelixab@gmail.com>



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

end of thread, other threads:[~2026-11-28  1:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28  1:58 [PATCH] usb: phy: fsl-usb: use NULL instead of plain integer 0 Felix Huang via B4 Relay
2026-11-28  1:59 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox