diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2013-06-05 03:34:03 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-20 03:04:36 -0400 |
commit | 2d5c121678ce2c7e12ecc174121badeea0b98fe0 (patch) | |
tree | 770af62b61e279dfcd88f1c8e368c0dd9271557e | |
parent | 5fb621698e94e3af8b413d9439041fde48e2784d (diff) |
powerpc/eeh: Enhance converting EEH dev
Under some special circumstances, the EEH device doesn't have the
associated device tree node or PCI device. The patch enhances those
functions converting EEH device to device tree node or PCI device
accordingly to avoid unnecessary system crash.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/eeh.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index a80e32b46c11..e32c3c53eb8b 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h | |||
@@ -95,12 +95,12 @@ struct eeh_dev { | |||
95 | 95 | ||
96 | static inline struct device_node *eeh_dev_to_of_node(struct eeh_dev *edev) | 96 | static inline struct device_node *eeh_dev_to_of_node(struct eeh_dev *edev) |
97 | { | 97 | { |
98 | return edev->dn; | 98 | return edev ? edev->dn : NULL; |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline struct pci_dev *eeh_dev_to_pci_dev(struct eeh_dev *edev) | 101 | static inline struct pci_dev *eeh_dev_to_pci_dev(struct eeh_dev *edev) |
102 | { | 102 | { |
103 | return edev->pdev; | 103 | return edev ? edev->pdev : NULL; |
104 | } | 104 | } |
105 | 105 | ||
106 | /* | 106 | /* |