aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@austin.ibm.com>2006-03-31 13:04:52 -0500
committerPaul Mackerras <paulus@samba.org>2006-04-01 06:37:11 -0500
commit794e085e56a67921eea80bcaeeac38d1517369be (patch)
treeaf82eeb1156db92daa05ab2bf83b0566731a3ff7 /arch/powerpc
parent34422fed65bb1cf609892d73f1cf5e9626445f9e (diff)
[PATCH] powerpc/pseries: EEH Cleanup
This patch removes unnecessary exports, marks functions as static when possible, and simplifies some list-related code. Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com> Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 9b2b1cb117b3..780fb27a0099 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -865,7 +865,7 @@ void __init eeh_init(void)
865 * on the CEC architecture, type of the device, on earlier boot 865 * on the CEC architecture, type of the device, on earlier boot
866 * command-line arguments & etc. 866 * command-line arguments & etc.
867 */ 867 */
868void eeh_add_device_early(struct device_node *dn) 868static void eeh_add_device_early(struct device_node *dn)
869{ 869{
870 struct pci_controller *phb; 870 struct pci_controller *phb;
871 struct eeh_early_enable_info info; 871 struct eeh_early_enable_info info;
@@ -882,7 +882,6 @@ void eeh_add_device_early(struct device_node *dn)
882 info.buid_lo = BUID_LO(phb->buid); 882 info.buid_lo = BUID_LO(phb->buid);
883 early_enable_eeh(dn, &info); 883 early_enable_eeh(dn, &info);
884} 884}
885EXPORT_SYMBOL_GPL(eeh_add_device_early);
886 885
887void eeh_add_device_tree_early(struct device_node *dn) 886void eeh_add_device_tree_early(struct device_node *dn)
888{ 887{
@@ -893,20 +892,6 @@ void eeh_add_device_tree_early(struct device_node *dn)
893} 892}
894EXPORT_SYMBOL_GPL(eeh_add_device_tree_early); 893EXPORT_SYMBOL_GPL(eeh_add_device_tree_early);
895 894
896void eeh_add_device_tree_late(struct pci_bus *bus)
897{
898 struct pci_dev *dev;
899
900 list_for_each_entry(dev, &bus->devices, bus_list) {
901 eeh_add_device_late(dev);
902 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
903 struct pci_bus *subbus = dev->subordinate;
904 if (subbus)
905 eeh_add_device_tree_late(subbus);
906 }
907 }
908}
909
910/** 895/**
911 * eeh_add_device_late - perform EEH initialization for the indicated pci device 896 * eeh_add_device_late - perform EEH initialization for the indicated pci device
912 * @dev: pci device for which to set up EEH 897 * @dev: pci device for which to set up EEH
@@ -914,7 +899,7 @@ void eeh_add_device_tree_late(struct pci_bus *bus)
914 * This routine must be used to complete EEH initialization for PCI 899 * This routine must be used to complete EEH initialization for PCI
915 * devices that were added after system boot (e.g. hotplug, dlpar). 900 * devices that were added after system boot (e.g. hotplug, dlpar).
916 */ 901 */
917void eeh_add_device_late(struct pci_dev *dev) 902static void eeh_add_device_late(struct pci_dev *dev)
918{ 903{
919 struct device_node *dn; 904 struct device_node *dn;
920 struct pci_dn *pdn; 905 struct pci_dn *pdn;
@@ -933,16 +918,33 @@ void eeh_add_device_late(struct pci_dev *dev)
933 918
934 pci_addr_cache_insert_device (dev); 919 pci_addr_cache_insert_device (dev);
935} 920}
936EXPORT_SYMBOL_GPL(eeh_add_device_late); 921
922void eeh_add_device_tree_late(struct pci_bus *bus)
923{
924 struct pci_dev *dev;
925
926 list_for_each_entry(dev, &bus->devices, bus_list) {
927 eeh_add_device_late(dev);
928 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
929 struct pci_bus *subbus = dev->subordinate;
930 if (subbus)
931 eeh_add_device_tree_late(subbus);
932 }
933 }
934}
935EXPORT_SYMBOL_GPL(eeh_add_device_tree_late);
937 936
938/** 937/**
939 * eeh_remove_device - undo EEH setup for the indicated pci device 938 * eeh_remove_device - undo EEH setup for the indicated pci device
940 * @dev: pci device to be removed 939 * @dev: pci device to be removed
941 * 940 *
942 * This routine should be when a device is removed from a running 941 * This routine should be called when a device is removed from
943 * system (e.g. by hotplug or dlpar). 942 * a running system (e.g. by hotplug or dlpar). It unregisters
943 * the PCI device from the EEH subsystem. I/O errors affecting
944 * this device will no longer be detected after this call; thus,
945 * i/o errors affecting this slot may leave this device unusable.
944 */ 946 */
945void eeh_remove_device(struct pci_dev *dev) 947static void eeh_remove_device(struct pci_dev *dev)
946{ 948{
947 struct device_node *dn; 949 struct device_node *dn;
948 if (!dev || !eeh_subsystem_enabled) 950 if (!dev || !eeh_subsystem_enabled)
@@ -958,21 +960,17 @@ void eeh_remove_device(struct pci_dev *dev)
958 PCI_DN(dn)->pcidev = NULL; 960 PCI_DN(dn)->pcidev = NULL;
959 pci_dev_put (dev); 961 pci_dev_put (dev);
960} 962}
961EXPORT_SYMBOL_GPL(eeh_remove_device);
962 963
963void eeh_remove_bus_device(struct pci_dev *dev) 964void eeh_remove_bus_device(struct pci_dev *dev)
964{ 965{
966 struct pci_bus *bus = dev->subordinate;
967 struct pci_dev *child, *tmp;
968
965 eeh_remove_device(dev); 969 eeh_remove_device(dev);
966 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 970
967 struct pci_bus *bus = dev->subordinate; 971 if (bus && dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
968 struct list_head *ln; 972 list_for_each_entry_safe(child, tmp, &bus->devices, bus_list)
969 if (!bus) 973 eeh_remove_bus_device(child);
970 return;
971 for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
972 struct pci_dev *pdev = pci_dev_b(ln);
973 if (pdev)
974 eeh_remove_bus_device(pdev);
975 }
976 } 974 }
977} 975}
978EXPORT_SYMBOL_GPL(eeh_remove_bus_device); 976EXPORT_SYMBOL_GPL(eeh_remove_bus_device);