mtd: Use mtd->name when registering nvmem device
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Mon, 11 Feb 2019 13:33:37 +0000 (19:03 +0530)
committerBoris Brezillon <boris.brezillon@collabora.com>
Wed, 13 Feb 2019 13:10:22 +0000 (14:10 +0100)
With this patch, we use the mtd->name instead of concatenating the name
with '0'.

Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
drivers/mtd/mtdcore.c

index 999b705769a847754b7a8e4df63f3b34c82bb4b7..3ef01baef9b62d1085de674b43f6310fbdc62821 100644 (file)
@@ -507,6 +507,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
 {
        struct nvmem_config config = {};
 
+       config.id = -1;
        config.dev = &mtd->dev;
        config.name = mtd->name;
        config.owner = THIS_MODULE;