[PATCH] mtd: nand: assign mtd->name in find_full_id_nand
Caizhiyong
caizhiyong at hisilicon.com
Wed Dec 25 20:51:58 EST 2013
From: Cai Zhiyong <caizhiyong at huawei.com>
Date: Wed, 25 Dec 2013 21:19:21 +0800
Subject: [PATCH] mtd: nand: assign mtd->name in find_full_id_nand
This patch assigned the type->name to mtd->name when mtd->name is
NULL in function "find_full_id_nand".
mtd->name is NULL may cause some problem.
Signed-off-by: Cai Zhiyong <caizhiyong at huawei.com>
---
drivers/mtd/nand/nand_base.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 9b3bb3c..404e83d 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3327,6 +3327,9 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
*busw = type->options & NAND_BUSWIDTH_16;
+ if (!mtd->name)
+ mtd->name = type->name;
+
return true;
}
return false;
--
1.8.1.5
More information about the linux-mtd
mailing list