Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: ohci: use IS_REACHABLE(CONFIG_MFD_SM501) for SM501 glue
@ 2026-12-04  2:28 Pengpeng Hou
  2026-12-04  2:41 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-12-04  2:28 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman; +Cc: linux-usb, Pengpeng Hou, Lee Jones, mfd

The SM501 MFD can create an OHCI platform device even when the MFD and
OHCI drivers are modules. In that case the OHCI module currently omits
the matching SM501 glue.

Check reachability when including the glue; retain the built-in/module
linkage restriction.

The issue was found by our static-analysis tool and manually reviewed.

Fixes: f54aab6ebcec ("usb: ohci-sm501 driver")
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built ohci-hcd.o on x86-64 with GCC 11.4 and W=1 (CONFIG_USB_OHCI_HCD=m,
CONFIG_MFD_SM501=m). No runtime or hardware test was performed.

 drivers/usb/host/ohci-hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 129468b1efc25e8e9881ee09b9ef52cd371aedd8..acfc83fc45d8248bbf0cbb9ebce5dbcaec61afff 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1268,7 +1268,7 @@ MODULE_LICENSE ("GPL");
 #define PS3_SYSTEM_BUS_DRIVER	ps3_ohci_driver
 #endif
 
-#ifdef CONFIG_MFD_SM501
+#if IS_REACHABLE(CONFIG_MFD_SM501)
 #include "ohci-sm501.c"
 #define SM501_OHCI_DRIVER	ohci_hcd_sm501_driver
 #endif

base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106


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

end of thread, other threads:[~2026-12-04  2:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  2:28 [PATCH] usb: ohci: use IS_REACHABLE(CONFIG_MFD_SM501) for SM501 glue Pengpeng Hou
2026-12-04  2:41 ` sashiko-bot

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