Re: [PATCH v2 4/7] mlxsw: don't keep pci_device_id
From: Petr Machata
Date: Wed Jul 01 2026 - 10:09:40 EST
Gary Guo <gary@xxxxxxxxxxx> writes:
> pci_device_id is not guaranteed to live longer than probe due to presence
> of dynamic ID. This stored ID is unused so remove it.
>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> drivers/net/ethernet/mellanox/mlxsw/pci.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
> index 0da85d36647d..bfe3268dfdc1 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
> @@ -1768,7 +1767,6 @@ static void mlxsw_pci_mbox_free(struct mlxsw_pci *mlxsw_pci,
> }
>
> static int mlxsw_pci_sys_ready_wait(struct mlxsw_pci *mlxsw_pci,
> - const struct pci_device_id *id,
> u32 *p_sys_status)
> {
> unsigned long end;
I see, we used this to detect whether we are on SwitchX-2. Support far
that was dropped ages ago in commit b0d80c013b04 ("mlxsw: Remove
Mellanox SwitchX-2 ASIC support").
Good cleanup, thanks.
Reviewed-by: Petr Machata <petrm@xxxxxxxxxx>