lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f3aacf4-5885-48b3-9af8-36208fb464a9@intel.com>
Date: Fri, 29 Aug 2025 14:19:24 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Stefan Wahren <wahrenst@....net>, Parthiban Veerasooran
	<parthiban.veerasooran@...rochip.com>, Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
CC: <linux-spi@...r.kernel.org>, <netdev@...r.kernel.org>,
	<stable@...nel.org>, Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH V2 2/3 net] microchip: lan865x: Fix module autoloading



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 <wahrenst@....net>
> Cc: stable@...nel.org
> Reviewed-by: Andrew Lunn <andrew@...n.ch>
> ---
>  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 <jacob.e.keller@...el.com>

>  
>  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);
>  



Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ