diff mbox series

[1/2] mtd: spi-nor: Remove debugfs entries that duplicate sysfs entries

Message ID 20211217122636.474976-2-tudor.ambarus@microchip.com
State Accepted
Delegated to: Ambarus Tudor
Headers show
Series mtd: core: Remove partid and partname debugfs files | expand

Commit Message

Tudor Ambarus Dec. 17, 2021, 12:26 p.m. UTC
SPI NOR sysfs defines partname and jedec_id device attributes, which
duplicate the information from debugfs. Since the sysfs directory
structure and the attributes in each directory define an ABI between the
kernel and user space, thus it can never be removed, remove the debugfs
entries so that we don't duplicate the information.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/spi-nor/core.c | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Pratyush Yadav Dec. 20, 2021, 12:59 p.m. UTC | #1
On 17/12/21 02:26PM, Tudor Ambarus wrote:
> SPI NOR sysfs defines partname and jedec_id device attributes, which
> duplicate the information from debugfs. Since the sysfs directory
> structure and the attributes in each directory define an ABI between the
> kernel and user space, thus it can never be removed, remove the debugfs
> entries so that we don't duplicate the information.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 2e21d5ac0e2d..435bd17af0b4 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3126,16 +3126,6 @@  static const struct flash_info *spi_nor_match_id(struct spi_nor *nor,
 	return NULL;
 }
 
-static void spi_nor_debugfs_init(struct spi_nor *nor,
-				 const struct flash_info *info)
-{
-	struct mtd_info *mtd = &nor->mtd;
-
-	mtd->dbg.partname = info->name;
-	mtd->dbg.partid = devm_kasprintf(nor->dev, GFP_KERNEL, "spi-nor:%*phN",
-					 info->id_len, info->id);
-}
-
 static const struct flash_info *spi_nor_get_flash_info(struct spi_nor *nor,
 						       const char *name)
 {
@@ -3243,8 +3233,6 @@  int spi_nor_scan(struct spi_nor *nor, const char *name,
 
 	nor->info = info;
 
-	spi_nor_debugfs_init(nor, info);
-
 	mutex_init(&nor->lock);
 
 	/* Init flash parameters based on flash_info struct and SFDP */