On 7/22/19 8:22 AM, Ji-Ze Hong (Peter Hong) wrote: > This patch add support for Fintek PCIE to 2 CAN controller support > > Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@xxxxxxxxx> > --- > Changelog: > v2: > 1: Fix comment on the spinlock with write access. > 2: Use ARRAY_SIZE instead of F81601_PCI_MAX_CHAN. > 3: Check the strap pin outside the loop. > 4: Fix the cleanup issue in f81601_pci_add_card(). > 5: Remove unused "channels" in struct f81601_pci_card. > > drivers/net/can/sja1000/Kconfig | 8 ++ > drivers/net/can/sja1000/Makefile | 1 + > drivers/net/can/sja1000/f81601.c | 215 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 224 insertions(+) > create mode 100644 drivers/net/can/sja1000/f81601.c > diff --git a/drivers/net/can/sja1000/f81601.c b/drivers/net/can/sja1000/f81601.c > new file mode 100644 > index 000000000000..3c378de8764d > --- /dev/null > +++ b/drivers/net/can/sja1000/f81601.c [...] > +static void f81601_pci_del_card(struct pci_dev *pdev) > +{ > + struct f81601_pci_card *card = pci_get_drvdata(pdev); > + struct net_device *dev; > + int i = 0; > + > + for (i = 0; i < ARRAY_SIZE(card->net_dev); i++) { > + dev = card->net_dev[i]; > + if (!dev) > + continue; > + > + dev_info(&pdev->dev, "%s: Removing %s\n", __func__, dev->name); > + > + unregister_sja1000dev(dev); > + free_sja1000dev(dev); > + } > + > + pcim_iounmap(pdev, card->addr); Why do you need iounmap()? > +} Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Attachment:
signature.asc
Description: OpenPGP digital signature