mtd: physmap_of: assign parent for the concatenated MTD

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:04 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8361a9b8cb6a9c71b7cf884a87b2532d8367c185
Commit:     8361a9b8cb6a9c71b7cf884a87b2532d8367c185
Parent:     e270bca531b40cd0a143176eb093d173b9c6f418
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Fri Oct 30 20:33:30 2015 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Nov 11 13:59:08 2015 -0800

    mtd: physmap_of: assign parent for the concatenated MTD
    
    If there is more than one map region for this device, then the
    concatenated MTD will not have a parent device assigned to it -- only
    the sub-devices (which are not actually registered with the framework)
    will have their parents assigned. Let's assign the concatenated device
    correctly.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Reviewed-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/maps/physmap_of.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index b782656..70c4531 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -309,6 +309,7 @@ static int of_flash_probe(struct platform_device *dev)
 	if (err)
 		goto err_out;
 
+	info->cmtd->dev.parent = &dev->dev;
 	mtd_set_of_node(info->cmtd, dp);
 	part_probe_types = of_get_probes(dp);
 	if (!part_probe_types) {



More information about the linux-mtd-cvs mailing list