[PATCH 2/2] MCI: init device_node for MCI mainarea cdev

Lucas Stach l.stach at pengutronix.de
Tue Dec 8 09:33:29 PST 2015


This fixes a regression, where boards specifying the environment
path using the form device-path = &phandle, "partname:part" would
be unable to find their env.

This is due to of_find_path() switching to cdev_by_device_node()
internally, which expects the device_node member of the main
area cdev to be initialized.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/mci/mci-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 4e6b83be5f43..24f57f9da9a4 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -437,6 +437,9 @@ static void mci_part_add(struct mci *mci, uint64_t size,
 	part->area_type = area_type;
 	part->part_cfg = part_cfg;
 
+	if (area_type == MMC_BLK_DATA_AREA_MAIN)
+		part->blk.cdev.device_node = mci->host->hw_dev->device_node;
+
 	mci->nr_parts++;
 }
 
-- 
2.6.2




More information about the barebox mailing list