mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
mlxsw: pci: Don't store pci_device_id
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@garyguo.net> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Petr Machata <petrm@nvidia.com> Link: https://patch.msgid.link/20260723-pci_id_fix-v4-4-3580726844e1@garyguo.net
This commit is contained in:
parent
9a1b9aa5ce
commit
1ae2920768
|
|
@ -130,7 +130,6 @@ struct mlxsw_pci {
|
|||
} comp;
|
||||
} cmd;
|
||||
struct mlxsw_bus_info bus_info;
|
||||
const struct pci_device_id *id;
|
||||
enum mlxsw_pci_cqe_v max_cqe_ver; /* Maximal supported CQE version */
|
||||
u8 num_cqs; /* Number of CQs */
|
||||
u8 num_sdqs; /* Number of SDQs */
|
||||
|
|
@ -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;
|
||||
|
|
@ -1839,7 +1837,7 @@ static int mlxsw_pci_reset_sw(struct mlxsw_pci *mlxsw_pci)
|
|||
}
|
||||
|
||||
static int
|
||||
mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
|
||||
mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci)
|
||||
{
|
||||
struct pci_dev *pdev = mlxsw_pci->pdev;
|
||||
bool pci_reset_sbr_supported = false;
|
||||
|
|
@ -1848,7 +1846,7 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
|
|||
u32 sys_status;
|
||||
int err;
|
||||
|
||||
err = mlxsw_pci_sys_ready_wait(mlxsw_pci, id, &sys_status);
|
||||
err = mlxsw_pci_sys_ready_wait(mlxsw_pci, &sys_status);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to reach system ready status before reset. Status is 0x%x\n",
|
||||
sys_status);
|
||||
|
|
@ -1880,7 +1878,7 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
err = mlxsw_pci_sys_ready_wait(mlxsw_pci, id, &sys_status);
|
||||
err = mlxsw_pci_sys_ready_wait(mlxsw_pci, &sys_status);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to reach system ready status after reset. Status is 0x%x\n",
|
||||
sys_status);
|
||||
|
|
@ -1932,7 +1930,7 @@ static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core,
|
|||
if (!mbox)
|
||||
return -ENOMEM;
|
||||
|
||||
err = mlxsw_pci_reset(mlxsw_pci, mlxsw_pci->id);
|
||||
err = mlxsw_pci_reset(mlxsw_pci);
|
||||
if (err)
|
||||
goto err_reset;
|
||||
|
||||
|
|
@ -2464,7 +2462,6 @@ static int mlxsw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
mlxsw_pci->bus_info.device_name = pci_name(mlxsw_pci->pdev);
|
||||
mlxsw_pci->bus_info.dev = &pdev->dev;
|
||||
mlxsw_pci->bus_info.read_clock_capable = true;
|
||||
mlxsw_pci->id = id;
|
||||
|
||||
err = mlxsw_core_bus_device_register(&mlxsw_pci->bus_info,
|
||||
&mlxsw_pci_bus, mlxsw_pci, false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user