/* Return the "partitionable endpoint" (pe) under which this device lies  */
struct device_node* find_device_pe(struct device_node *dn)
/* Return the "partitionable endpoint" (pe) under which this device lies  */
struct device_node* find_device_pe(struct device_node *dn)
{
	while ((dn->parent) && PCI_DN(dn->parent) &&
	      (PCI_DN(dn->parent)->eeh_mode & EEH_MODE_SUPPORTED)) {
		dn = dn->parent;
	}
	return dn;
}