From: sashiko-bot@kernel.org
To: "Pengpeng Hou" <hppiscas@163.com>
Cc: linux-usb@vger.kernel.org, mfd@lists.linux.dev, lee@kernel.org
Subject: Re: [PATCH] usb: ohci: use IS_REACHABLE(CONFIG_MFD_SM501) for SM501 glue
Date: Fri, 04 Dec 2026 02:41:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-248996@kernel.org> (raw)
In-Reply-To: <179635133288.74470.3309482874196875020@163.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] usb: ohci: IS_REACHABLE(CONFIG_MFD_SM501) couples ohci-hcd.ko
to sm501.ko
--
commit bcdfc91876aa48e5c117d4d8258a5503ecae195e
Author: Pengpeng Hou <hppiscas@163.com>
usb: ohci: use IS_REACHABLE(CONFIG_MFD_SM501) for SM501 glue
This commit changes the preprocessor guard around ohci-sm501.c in
drivers/usb/host/ohci-hcd.c from #ifdef CONFIG_MFD_SM501 to
#if IS_REACHABLE(CONFIG_MFD_SM501) so the SM501 glue is included when
both ohci-hcd and sm501 are built as modules.
> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
> index 129468b1efc25..acfc83fc45d82 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
[Severity: High]
Does this introduce a hard module dependency from ohci-hcd.ko onto
sm501.ko?
When CONFIG_USB_OHCI_HCD=m and CONFIG_MFD_SM501=m, embedding ohci-sm501.c
into ohci-hcd.ko pulls in calls to sm501_unit_power() and
sm501_modify_reg(), which are exported by sm501.ko.
Because standalone OHCI drivers such as ohci-pci.ko depend on ohci-hcd.ko
via ohci_init_driver(), loading any modular OHCI driver now forces
sm501.ko to load on systems without SM501 hardware, and fails in minimal
initramfs images or split-package kernels where sm501.ko is absent.
This also leaves CONFIG_USB_OHCI_HCD=y with CONFIG_MFD_SM501=m
unsupported, since IS_REACHABLE() evaluates to false when ohci-hcd is
built in.
Splitting ohci-sm501.c into a standalone platform driver module using
ohci_init_driver() and MODULE_ALIAS("platform:sm501-usb") would avoid
coupling ohci-hcd.ko to sm501.ko while supporting both modular and
built-in ohci-hcd configurations.
--
Sashiko AI review · https://sashiko.dev/#/patchset/179635133288.74470.3309482874196875020@163.com?part=1
prev parent reply other threads:[~2026-12-04 2:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=sashiko-outbox-248996@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hppiscas@163.com \
--cc=lee@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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