On 8/27/2025 4:53 AM, Stefan Wahren wrote: > Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded > based on the alias from spi_device_id table. While at this, fix > the misleading variable name (spidev is unrelated to this driver). > spidev likely is just someone short-handing the spi_device_id. Makes sense to call this by the driver name. > Fixes: 5cd2340cb6a3 ("microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY") > Signed-off-by: Stefan Wahren > Cc: stable@kernel.org > Reviewed-by: Andrew Lunn > --- > drivers/net/ethernet/microchip/lan865x/lan865x.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/microchip/lan865x/lan865x.c b/drivers/net/ethernet/microchip/lan865x/lan865x.c > index 84c41f193561..9d94c8fb8b91 100644 > --- a/drivers/net/ethernet/microchip/lan865x/lan865x.c > +++ b/drivers/net/ethernet/microchip/lan865x/lan865x.c > @@ -423,10 +423,11 @@ static void lan865x_remove(struct spi_device *spi) > free_netdev(priv->netdev); > } > > -static const struct spi_device_id spidev_spi_ids[] = { > +static const struct spi_device_id lan865x_ids[] = { > { .name = "lan8650" }, > {}, > }; > +MODULE_DEVICE_TABLE(spi, lan865x_ids); Right. Without MODULE_DEVICE_TABLE, the tables used by userspace won't populate with this driver. That results in failure to automatically load the module. Makes sense. Reviewed-by: Jacob Keller > > static const struct of_device_id lan865x_dt_ids[] = { > { .compatible = "microchip,lan8650" }, > @@ -441,7 +442,7 @@ static struct spi_driver lan865x_driver = { > }, > .probe = lan865x_probe, > .remove = lan865x_remove, > - .id_table = spidev_spi_ids, > + .id_table = lan865x_ids, > }; > module_spi_driver(lan865x_driver); >