mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
can: kvaser_pciefd: Add intermediate variable for device struct in probe()
Add intermediate variable, for readability and to simplify future patches. Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Jimmy Assarsson <extja@kvaser.com> Link: https://patch.msgid.link/20250725123230.8-4-extja@kvaser.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
e74249a00b
commit
69a2cb633c
|
|
@ -1813,10 +1813,11 @@ static int kvaser_pciefd_probe(struct pci_dev *pdev,
|
|||
const struct pci_device_id *id)
|
||||
{
|
||||
int ret;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct kvaser_pciefd *pcie;
|
||||
const struct kvaser_pciefd_irq_mask *irq_mask;
|
||||
|
||||
pcie = devm_kzalloc(&pdev->dev, sizeof(*pcie), GFP_KERNEL);
|
||||
pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
|
||||
if (!pcie)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1855,7 +1856,7 @@ static int kvaser_pciefd_probe(struct pci_dev *pdev,
|
|||
|
||||
ret = pci_alloc_irq_vectors(pcie->pci, 1, 1, PCI_IRQ_INTX | PCI_IRQ_MSI);
|
||||
if (ret < 0) {
|
||||
dev_err(&pcie->pci->dev, "Failed to allocate IRQ vectors.\n");
|
||||
dev_err(dev, "Failed to allocate IRQ vectors.\n");
|
||||
goto err_teardown_can_ctrls;
|
||||
}
|
||||
|
||||
|
|
@ -1868,7 +1869,7 @@ static int kvaser_pciefd_probe(struct pci_dev *pdev,
|
|||
ret = request_irq(pcie->pci->irq, kvaser_pciefd_irq_handler,
|
||||
IRQF_SHARED, KVASER_PCIEFD_DRV_NAME, pcie);
|
||||
if (ret) {
|
||||
dev_err(&pcie->pci->dev, "Failed to request IRQ %d\n", pcie->pci->irq);
|
||||
dev_err(dev, "Failed to request IRQ %d\n", pcie->pci->irq);
|
||||
goto err_pci_free_irq_vectors;
|
||||
}
|
||||
iowrite32(KVASER_PCIEFD_SRB_IRQ_DPD0 | KVASER_PCIEFD_SRB_IRQ_DPD1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user