Commit 138e6f57 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] PCI: add hook for PCI resource deallocation

From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

This patch adds a hook 'pcibios_disable_device()' into pci_disable_device()
to call architecture specific PCI resource deallocation code.  It's a
opposite part of pcibios_enable_device().  We need this hook to deallocate
architecture specific PCI resource such as IRQ resource, etc..  This patch
is just for adding the hook, so 'pcibios_disable_device()' is defined as a
null function on all architecture so far.

I tested this patch on i386, x86_64 and ia64.  But it has not been tested
on other architectures because I don't have these machines.
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent fc9e06d5
......@@ -374,6 +374,16 @@ pci_enable_device(struct pci_dev *dev)
return 0;
}
/**
* pcibios_disable_device - disable arch specific PCI resources for device dev
* @dev: the PCI device to disable
*
* Disables architecture specific PCI resources for the device. This
* is the default implementation. Architecture implementations can
* override this.
*/
void __attribute__ ((weak)) pcibios_disable_device (struct pci_dev *dev) {}
/**
* pci_disable_device - Disable PCI device after use
* @dev: PCI device to be disabled
......@@ -394,6 +404,8 @@ pci_disable_device(struct pci_dev *dev)
pci_command &= ~PCI_COMMAND_MASTER;
pci_write_config_word(dev, PCI_COMMAND, pci_command);
}
pcibios_disable_device(dev);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment