[v3,1/2] drivers/mtd: Use mtd->name when registering nvmem device

Message ID 20190211133338.30399-1-aneesh.kumar@linux.ibm.com
State Accepted
Delegated to: Boris Brezillon
Headers show
Series
  • [v3,1/2] drivers/mtd: Use mtd->name when registering nvmem device
Related show

Commit Message

Aneesh Kumar K.V Feb. 11, 2019, 1:33 p.m.
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>
---
 drivers/mtd/mtdcore.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Boris Brezillon Feb. 14, 2019, 1:04 p.m. | #1
From: Boris Brezillon <bbrezillon@kernel.org>

On Mon, 2019-02-11 at 13:33:37 UTC, "Aneesh Kumar K.V" wrote:
> 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>

Applied to http://git.infradead.org/linux-mtd.git mtd/fixes, thanks.

Boris

Patch

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 999b705769a8..3ef01baef9b6 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -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;