Skip to content

Commit

Permalink
powerpc/eeh: Remove eeh device from OF node
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gavin Shan authored and Benjamin Herrenschmidt committed Mar 28, 2012
1 parent e22057c commit 2a0352f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 8 additions & 0 deletions arch/powerpc/include/asm/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ struct pci_dn {

struct pci_dev *pcidev; /* back-pointer to the pci device */
#ifdef CONFIG_EEH
struct eeh_dev *edev; /* eeh device */
int class_code; /* pci device class */
int eeh_mode; /* See eeh.h for possible EEH_MODEs */
int eeh_config_addr;
Expand Down Expand Up @@ -185,6 +186,13 @@ static inline int pci_device_from_OF_node(struct device_node *np,
return 0;
}

#if defined(CONFIG_EEH)
static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn)
{
return PCI_DN(dn)->edev;
}
#endif

/** Find the bus corresponding to the indicated device node */
extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/eeh_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void * __devinit eeh_dev_init(struct device_node *dn, void *data)
}

/* Associate EEH device with OF node */
dn->edev = edev;
PCI_DN(dn)->edev = edev;
edev->dn = dn;
edev->phb = phb;

Expand Down
10 changes: 0 additions & 10 deletions include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ struct device_node {
struct kref kref;
unsigned long _flags;
void *data;
#if defined(CONFIG_EEH)
struct eeh_dev *edev;
#endif
#if defined(CONFIG_SPARC)
char *path_component_name;
unsigned int unique_id;
Expand All @@ -75,13 +72,6 @@ struct of_phandle_args {
uint32_t args[MAX_PHANDLE_ARGS];
};

#if defined(CONFIG_EEH)
static inline struct eeh_dev *of_node_to_eeh_dev(struct device_node *dn)
{
return dn->edev;
}
#endif

#ifdef CONFIG_OF_DYNAMIC
extern struct device_node *of_node_get(struct device_node *node);
extern void of_node_put(struct device_node *node);
Expand Down

0 comments on commit 2a0352f

Please sign in to comment.