mtd: physmap_of: fix cmdline partition method w/o linux, mtd-name
authorBaruch Siach <baruch@tkos.co.il>
Sun, 23 Dec 2012 11:10:50 +0000 (13:10 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 19 Jan 2013 09:53:45 +0000 (09:53 +0000)
Commit d68cbdd4fb (mtd: physmap_of: allow to specify the mtd name for retro
compatiblity) broke cmdline partitioning using dev_name() in the kernel command
line.  of_property_read_string() does not touch mtd_name when linux,mtd-name is
not present in the device tree, which causes map.name to be set to a random
value.  Fix this by initializing mtd_name to NULL.

Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/maps/physmap_of.c

index 37cdc201652f612406883f60243121fc78d55a60..6fb2bd83d7defd4d14b4749b9588055dddbfbeeb 100644 (file)
@@ -170,7 +170,7 @@ static int of_flash_probe(struct platform_device *dev)
        resource_size_t res_size;
        struct mtd_part_parser_data ppdata;
        bool map_indirect;
-       const char *mtd_name;
+       const char *mtd_name = NULL;
 
        match = of_match_device(of_flash_match, &dev->dev);
        if (!match)