diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-03-20 17:30:27 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-27 20:31:57 -0400 |
commit | 2a0352fa4a78081c76be1e450b51a6aa27c92616 (patch) | |
tree | cacc28c7f6058cdc5bbf3d940917ca06ef1df84e | |
parent | e22057c8599373e5caef0bc42bdb95d2a361ab0d (diff) |
powerpc/eeh: Remove eeh device from OF node
Originally, the PCI sensitive OF node is tracing the eeh device
through struct device_node->edev. However, it was regarded as
bad idea.
The patch removes struct device_node->edev and uses PCI_DN to
trace the corresponding eeh device according to BenH's comments.
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/pci-bridge.h | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_dev.c | 2 | ||||
-rw-r--r-- | include/linux/of.h | 10 |
3 files changed, 9 insertions, 11 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 5d487657322e..21f99aec41b9 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h | |||
@@ -155,6 +155,7 @@ struct pci_dn { | |||
155 | 155 | ||
156 | struct pci_dev *pcidev; /* back-pointer to the pci device */ | 156 | struct pci_dev *pcidev; /* back-pointer to the pci device */ |
157 | #ifdef CONFIG_EEH | 157 | #ifdef CONFIG_EEH |
158 | struct eeh_dev *edev; /* eeh device */ | ||
158 | int class_code; /* pci device class */ | 159 | int class_code; /* pci device class */ |
159 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ | 160 | int eeh_mode; /* See eeh.h for possible EEH_MODEs */ |
160 | int eeh_config_addr; | 161 | int eeh_config_addr; |
@@ -185,6 +186,13 @@ static inline int pci_device_from_OF_node(struct device_node *np, | |||
185 | return 0; | 186 | return 0; |
186 | } | 187 | } |
187 | 188 | ||
189 | #if defined(CONFIG_EEH) | ||
190 | static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn) | ||
191 | { | ||
192 | return PCI_DN(dn)->edev; | ||
193 | } | ||
194 | #endif | ||
195 | |||
188 | /** Find the bus corresponding to the indicated device node */ | 196 | /** Find the bus corresponding to the indicated device node */ |
189 | extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn); | 197 | extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn); |
190 | 198 | ||
diff --git a/arch/powerpc/platforms/pseries/eeh_dev.c b/arch/powerpc/platforms/pseries/eeh_dev.c index f3aed7dcae95..c4507d095900 100644 --- a/arch/powerpc/platforms/pseries/eeh_dev.c +++ b/arch/powerpc/platforms/pseries/eeh_dev.c | |||
@@ -62,7 +62,7 @@ void * __devinit eeh_dev_init(struct device_node *dn, void *data) | |||
62 | } | 62 | } |
63 | 63 | ||
64 | /* Associate EEH device with OF node */ | 64 | /* Associate EEH device with OF node */ |
65 | dn->edev = edev; | 65 | PCI_DN(dn)->edev = edev; |
66 | edev->dn = dn; | 66 | edev->dn = dn; |
67 | edev->phb = phb; | 67 | edev->phb = phb; |
68 | 68 | ||
diff --git a/include/linux/of.h b/include/linux/of.h index d46a18ffbebb..f02d8b2f799d 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -58,9 +58,6 @@ struct device_node { | |||
58 | struct kref kref; | 58 | struct kref kref; |
59 | unsigned long _flags; | 59 | unsigned long _flags; |
60 | void *data; | 60 | void *data; |
61 | #if defined(CONFIG_EEH) | ||
62 | struct eeh_dev *edev; | ||
63 | #endif | ||
64 | #if defined(CONFIG_SPARC) | 61 | #if defined(CONFIG_SPARC) |
65 | char *path_component_name; | 62 | char *path_component_name; |
66 | unsigned int unique_id; | 63 | unsigned int unique_id; |
@@ -75,13 +72,6 @@ struct of_phandle_args { | |||
75 | uint32_t args[MAX_PHANDLE_ARGS]; | 72 | uint32_t args[MAX_PHANDLE_ARGS]; |
76 | }; | 73 | }; |
77 | 74 | ||
78 | #if defined(CONFIG_EEH) | ||
79 | static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn) | ||
80 | { | ||
81 | return dn->edev; | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | #ifdef CONFIG_OF_DYNAMIC | 75 | #ifdef CONFIG_OF_DYNAMIC |
86 | extern struct device_node *of_node_get(struct device_node *node); | 76 | extern struct device_node *of_node_get(struct device_node *node); |
87 | extern void of_node_put(struct device_node *node); | 77 | extern void of_node_put(struct device_node *node); |