summaryrefslogtreecommitdiff
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2013-06-05 15:34:03 +0800
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-20 17:04:36 +1000
commit2d5c121678ce2c7e12ecc174121badeea0b98fe0 (patch)
tree770af62b61e279dfcd88f1c8e368c0dd9271557e /arch/powerpc/include
parent5fb621698e94e3af8b413d9439041fde48e2784d (diff)
downloadlwn-2d5c121678ce2c7e12ecc174121badeea0b98fe0.tar.gz
lwn-2d5c121678ce2c7e12ecc174121badeea0b98fe0.zip
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>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/eeh.h4
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 {
static inline struct device_node *eeh_dev_to_of_node(struct eeh_dev *edev)
{
- return edev->dn;
+ return edev ? edev->dn : NULL;
}
static inline struct pci_dev *eeh_dev_to_pci_dev(struct eeh_dev *edev)
{
- return edev->pdev;
+ return edev ? edev->pdev : NULL;
}
/*