[PATCH 5/5] mtd: onenand/samsung: Set name field of mtd_info struct

Paweł Chmiel pawel.mikolaj.chmiel at gmail.com
Fri Apr 26 09:42:24 PDT 2019


From: Tomasz Figa <tomasz.figa at gmail.com>

This patch adds initialization of .name field of mtd_info struct to
avoid printing "(null)" in kernel log messages, such as:

[    1.942519] 1 ofpart partitions found on MTD device (null)
[    1.949708] Creating 1 MTD partitions on "(null)":

Signed-off-by: Tomasz Figa <tomasz.figa at gmail.com>
Signed-off-by: Paweł Chmiel <pawel.mikolaj.chmiel at gmail.com>
---
 drivers/mtd/nand/onenand/samsung.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/onenand/samsung.c b/drivers/mtd/nand/onenand/samsung.c
index 0f450604412f..1fda1f324cc6 100644
--- a/drivers/mtd/nand/onenand/samsung.c
+++ b/drivers/mtd/nand/onenand/samsung.c
@@ -886,6 +886,7 @@ static int s3c_onenand_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	this = (struct onenand_chip *) &mtd[1];
+	mtd->name = dev_name(&pdev->dev);
 	mtd->priv = this;
 	mtd->dev.of_node = np;
 	mtd->dev.parent = &pdev->dev;
-- 
2.20.1




More information about the linux-mtd mailing list