From 4c3b7f285a440978f5fe0d12fcb1ae3c84ebecb4 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 30 Mar 2017 16:53:25 +0200 Subject: [PATCH] partition: do not overwrite an existing DT node pointer This is necessary to find EEPROM devices using the device tree nodes. Signed-off-by: Jan Luebbe --- drivers/of/partition.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/partition.c b/drivers/of/partition.c index 8c2aef232..a5f29542f 100644 --- a/drivers/of/partition.c +++ b/drivers/of/partition.c @@ -64,8 +64,8 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node) if (IS_ERR(new)) new = NULL; - if (new) - new->device_node = node;; + if (new && new->dev && !new->dev->device_node) + new->dev->device_node = node; free(filename);