diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 8a7cfb3..9e42702 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -26,6 +26,27 @@ EXPORT_SYMBOL_GPL(power_supply_class);
 
 static struct device_type power_supply_dev_type;
 
+static int __power_supply_is_supplied_by(struct power_supply *psy1,
+					 struct power_supply *psy2,
+					 int supply_idx)
+{
+
+	if (supply_idx < 0)
+		return -EINVAL;
+
+#ifdef CONFIG_OF
+	if (psy2->node && psy1->supplied_nodes)
+		if (psy1->supplied_nodes[supply_idx] == psy2->node)
+			return 0;
+#endif
+
+	if (psy2->name && psy1->supplied_to)
+		if (!strcmp(psy1->supplied_to[supply_idx], psy2->name))
+			return 0;
+
+	return -EINVAL;
+}
+
 static int __power_supply_changed_work(struct device *dev, void *data)
 {
 	struct power_supply *psy = (struct power_supply *)data;
@@ -33,7 +54,7 @@ static int __power_supply_changed_work(struct device *dev, void *data)
 	int i;
 
 	for (i = 0; i < psy->num_supplicants; i++)
-		if (!strcmp(psy->supplied_to[i], pst->name)) {
+		if (__power_supply_is_supplied_by(psy, pst, i)) {
 			if (pst->external_power_changed)
 				pst->external_power_changed(pst);
 		}
@@ -71,7 +92,7 @@ static int __power_supply_am_i_supplied(struct device *dev, void *data)
 	int i;
 
 	for (i = 0; i < epsy->num_supplicants; i++) {
-		if (!strcmp(epsy->supplied_to[i], psy->name)) {
+		if (__power_supply_is_supplied_by(epsy, psy, i)) {
 			if (epsy->get_property(epsy,
 				  POWER_SUPPLY_PROP_ONLINE, &ret))
 				continue;
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 1f0ab90..8c8693b 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -166,6 +166,10 @@ struct power_supply {
 	enum power_supply_property *properties;
 	size_t num_properties;
 
+#ifdef CONFIG_OF
+	struct device_node *node;
+	struct device_node **supplied_nodes;
+#endif
 	char **supplied_to;
 	size_t num_supplicants;
 
