diff options
-rw-r--r-- | arch/powerpc/include/asm/pci-bridge.h | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index a059cb94952b..025a130729bc 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h | |||
@@ -182,6 +182,14 @@ static inline int pci_device_from_OF_node(struct device_node *np, | |||
182 | #if defined(CONFIG_EEH) | 182 | #if defined(CONFIG_EEH) |
183 | static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn) | 183 | static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn) |
184 | { | 184 | { |
185 | /* | ||
186 | * For those OF nodes whose parent isn't PCI bridge, they | ||
187 | * don't have PCI_DN actually. So we have to skip them for | ||
188 | * any EEH operations. | ||
189 | */ | ||
190 | if (!dn || !PCI_DN(dn)) | ||
191 | return NULL; | ||
192 | |||
185 | return PCI_DN(dn)->edev; | 193 | return PCI_DN(dn)->edev; |
186 | } | 194 | } |
187 | #else | 195 | #else |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 43f6ed415564..9a04322b1736 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -728,7 +728,7 @@ static void eeh_add_device_early(struct device_node *dn) | |||
728 | { | 728 | { |
729 | struct pci_controller *phb; | 729 | struct pci_controller *phb; |
730 | 730 | ||
731 | if (!dn || !of_node_to_eeh_dev(dn)) | 731 | if (!of_node_to_eeh_dev(dn)) |
732 | return; | 732 | return; |
733 | phb = of_node_to_eeh_dev(dn)->phb; | 733 | phb = of_node_to_eeh_dev(dn)->phb; |
734 | 734 | ||