diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2013-08-14 16:06:05 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-08-15 13:38:45 -0400 |
commit | 9a3d2b9beefd5b07c1d8f70ded01b88f203ee304 (patch) | |
tree | 51aba33f4963d835195368743e31d116e3493199 /drivers/pci/pci.c | |
parent | 1b95ce8fc9c12fdb60047f2f9950f29e76e7c66d (diff) |
PCI: Add pci_probe_reset_slot() and pci_probe_reset_bus()
Users of pci_reset_bus() and pci_reset_slot() need a way to probe
whether the bus or slot supports reset. Add trivial helper functions
and export them as vfio-pci will make use of these.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ea5e70486174..7f89372483dd 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -3610,6 +3610,18 @@ static int pci_slot_reset(struct pci_slot *slot, int probe) | |||
3610 | } | 3610 | } |
3611 | 3611 | ||
3612 | /** | 3612 | /** |
3613 | * pci_probe_reset_slot - probe whether a PCI slot can be reset | ||
3614 | * @slot: PCI slot to probe | ||
3615 | * | ||
3616 | * Return 0 if slot can be reset, negative if a slot reset is not supported. | ||
3617 | */ | ||
3618 | int pci_probe_reset_slot(struct pci_slot *slot) | ||
3619 | { | ||
3620 | return pci_slot_reset(slot, 1); | ||
3621 | } | ||
3622 | EXPORT_SYMBOL_GPL(pci_probe_reset_slot); | ||
3623 | |||
3624 | /** | ||
3613 | * pci_reset_slot - reset a PCI slot | 3625 | * pci_reset_slot - reset a PCI slot |
3614 | * @slot: PCI slot to reset | 3626 | * @slot: PCI slot to reset |
3615 | * | 3627 | * |
@@ -3662,6 +3674,18 @@ static int pci_bus_reset(struct pci_bus *bus, int probe) | |||
3662 | } | 3674 | } |
3663 | 3675 | ||
3664 | /** | 3676 | /** |
3677 | * pci_probe_reset_bus - probe whether a PCI bus can be reset | ||
3678 | * @bus: PCI bus to probe | ||
3679 | * | ||
3680 | * Return 0 if bus can be reset, negative if a bus reset is not supported. | ||
3681 | */ | ||
3682 | int pci_probe_reset_bus(struct pci_bus *bus) | ||
3683 | { | ||
3684 | return pci_bus_reset(bus, 1); | ||
3685 | } | ||
3686 | EXPORT_SYMBOL_GPL(pci_probe_reset_bus); | ||
3687 | |||
3688 | /** | ||
3665 | * pci_reset_bus - reset a PCI bus | 3689 | * pci_reset_bus - reset a PCI bus |
3666 | * @bus: top level PCI bus to reset | 3690 | * @bus: top level PCI bus to reset |
3667 | * | 3691 | * |