Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: core: Remove partid and partname debugfs files

partid and partname debugfs files were used just by SPI NOR, but they were
replaced by sysfs entries. Since these debugfs files are no longer used in
mtd, remove dead code. The directory is kept as it is used by nandsim,
mtdswap and docg3.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220225144656.634682-1-tudor.ambarus@microchip.com

authored by

Tudor Ambarus and committed by
Miquel Raynal
ec090a03 d9a16830

+1 -37
+1 -34
drivers/mtd/mtdcore.c
··· 336 336 .release = mtd_release, 337 337 }; 338 338 339 - static int mtd_partid_debug_show(struct seq_file *s, void *p) 340 - { 341 - struct mtd_info *mtd = s->private; 342 - 343 - seq_printf(s, "%s\n", mtd->dbg.partid); 344 - 345 - return 0; 346 - } 347 - 348 - DEFINE_SHOW_ATTRIBUTE(mtd_partid_debug); 349 - 350 - static int mtd_partname_debug_show(struct seq_file *s, void *p) 351 - { 352 - struct mtd_info *mtd = s->private; 353 - 354 - seq_printf(s, "%s\n", mtd->dbg.partname); 355 - 356 - return 0; 357 - } 358 - 359 - DEFINE_SHOW_ATTRIBUTE(mtd_partname_debug); 360 - 361 339 static bool mtd_expert_analysis_mode; 362 340 363 341 #ifdef CONFIG_DEBUG_FS ··· 355 377 356 378 static void mtd_debugfs_populate(struct mtd_info *mtd) 357 379 { 358 - struct mtd_info *master = mtd_get_master(mtd); 359 380 struct device *dev = &mtd->dev; 360 - struct dentry *root; 361 381 362 382 if (IS_ERR_OR_NULL(dfs_dir_mtd)) 363 383 return; 364 384 365 - root = debugfs_create_dir(dev_name(dev), dfs_dir_mtd); 366 - mtd->dbg.dfs_dir = root; 367 - 368 - if (master->dbg.partid) 369 - debugfs_create_file("partid", 0400, root, master, 370 - &mtd_partid_debug_fops); 371 - 372 - if (master->dbg.partname) 373 - debugfs_create_file("partname", 0400, root, master, 374 - &mtd_partname_debug_fops); 385 + mtd->dbg.dfs_dir = debugfs_create_dir(dev_name(dev), dfs_dir_mtd); 375 386 } 376 387 377 388 #ifndef CONFIG_MMU
-3
include/linux/mtd/mtd.h
··· 188 188 */ 189 189 struct mtd_debug_info { 190 190 struct dentry *dfs_dir; 191 - 192 - const char *partname; 193 - const char *partid; 194 191 }; 195 192 196 193 /**