diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-06-04 07:44:44 +0200 |
---|---|---|
committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2023-06-06 00:54:23 +0200 |
commit | 14f6ca5b6ae759046fdc461633043bb05ff6de58 (patch) | |
tree | 859fcb6a8dd813cd43d1824537eb41d98f893ef2 /drivers/firewire | |
parent | firewire: ohci: use devres for memory object of ohci structure (diff) | |
download | linux-14f6ca5b6ae759046fdc461633043bb05ff6de58.tar.xz linux-14f6ca5b6ae759046fdc461633043bb05ff6de58.zip |
firewire: ohci: use devres for PCI-related resources
The PCI framework supports managed device resource to maintain the
lifetime of PCI specific resources.
This commit allows 1394 OHCI driver to utilize it.
Link: https://lore.kernel.org/r/20230604054451.161076-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/ohci.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 2b02cebcb0ae..f3d0882a876c 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -3588,7 +3588,7 @@ static int pci_probe(struct pci_dev *dev, pmac_ohci_on(dev); devres_add(&dev->dev, ohci); - err = pci_enable_device(dev); + err = pcim_enable_device(dev); if (err) { dev_err(&dev->dev, "failed to enable OHCI hardware\n"); return err; @@ -3605,14 +3605,13 @@ static int pci_probe(struct pci_dev *dev, if (!(pci_resource_flags(dev, 0) & IORESOURCE_MEM) || pci_resource_len(dev, 0) < OHCI1394_REGISTER_SIZE) { ohci_err(ohci, "invalid MMIO resource\n"); - err = -ENXIO; - goto fail_disable; + return -ENXIO; } err = pci_request_region(dev, 0, ohci_driver_name); if (err) { ohci_err(ohci, "MMIO resource unavailable\n"); - goto fail_disable; + return err; } ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); @@ -3752,8 +3751,6 @@ static int pci_probe(struct pci_dev *dev, pci_iounmap(dev, ohci->registers); fail_iomem: pci_release_region(dev, 0); - fail_disable: - pci_disable_device(dev); return err; } @@ -3798,7 +3795,6 @@ static void pci_remove(struct pci_dev *dev) pci_disable_msi(dev); pci_iounmap(dev, ohci->registers); pci_release_region(dev, 0); - pci_disable_device(dev); dev_notice(&dev->dev, "removing fw-ohci device\n"); } |