Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias
From: Manivannan Sadhasivam
Date: Sat Sep 05 2026 - 11:55:40 EST
On Sat, Sep 05, 2026 at 02:46:41PM +0000, Nick Huang wrote:
> On Sat, Sep 05, 2026 at 09:42:51PM +0800, hpp.iscas wrote:
> > The ESWIN PCIe host controller is a platform driver matched through
> > eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
> > published for OF module autoloading.
> >
> > Publish this platform-device table. Do not change the RISC-V host
> > initialization sequence or PCI device matching.
> >
> > Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
> > Signed-off-by: hpp.iscas <hppiscas@xxxxxxx>
> > ---
> > drivers/pci/controller/dwc/pcie-eswin.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c
> > index ce8d64f..1bb4469 100644
> > --- a/drivers/pci/controller/dwc/pcie-eswin.c
> > +++ b/drivers/pci/controller/dwc/pcie-eswin.c
> > @@ -388,6 +388,7 @@ static const struct of_device_id eswin_pcie_of_match[] = {
> > { .compatible = "eswin,eic7700-pcie", .data = &eswin_eic7700_data },
> > {}
> > };
> > +MODULE_DEVICE_TABLE(of, eswin_pcie_of_match);
> >
> > static struct platform_driver eswin_pcie_driver = {
> > .probe = eswin_pcie_probe,
> >
> Hi hpp.iscas
>
> Since this driver uses `builtin_platform_driver(eswin_pcie_driver)`, it
> appears to be built-in only. In that case, `MODULE_DEVICE_TABLE()` seems
> unnecessary.
>
Nope. builtin_platform_driver() only prevents removing the driver once loaded.
Since the driver is defined as 'tristate' in Kconfig, it can still be loaded
dynamically. So MODULE_DEVICE_TABLE() would still be necessary for udev to
autoload the module based on modalias.
- Mani
--
மணிவண்ணன் சதாசிவம்