mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] mtd: core: Remove partid and partname debugfs files
@ 2022-02-25 14:46 Tudor Ambarus
  2022-03-04  7:19 ` Tudor.Ambarus
  2022-03-14 15:59 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Tudor Ambarus @ 2022-02-25 14:46 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr
  Cc: linux-mtd, linux-kernel, Tudor Ambarus, Pratyush Yadav

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>
---
v2:
- update commit message
- collect R-b tag

 drivers/mtd/mtdcore.c   | 35 +----------------------------------
 include/linux/mtd/mtd.h |  3 ---
 2 files changed, 1 insertion(+), 37 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 1e7f3bbf847e..7dd105daf19d 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -336,28 +336,6 @@ static const struct device_type mtd_devtype = {
 	.release	= mtd_release,
 };
 
-static int mtd_partid_debug_show(struct seq_file *s, void *p)
-{
-	struct mtd_info *mtd = s->private;
-
-	seq_printf(s, "%s\n", mtd->dbg.partid);
-
-	return 0;
-}
-
-DEFINE_SHOW_ATTRIBUTE(mtd_partid_debug);
-
-static int mtd_partname_debug_show(struct seq_file *s, void *p)
-{
-	struct mtd_info *mtd = s->private;
-
-	seq_printf(s, "%s\n", mtd->dbg.partname);
-
-	return 0;
-}
-
-DEFINE_SHOW_ATTRIBUTE(mtd_partname_debug);
-
 static bool mtd_expert_analysis_mode;
 
 #ifdef CONFIG_DEBUG_FS
@@ -377,23 +355,12 @@ static struct dentry *dfs_dir_mtd;
 
 static void mtd_debugfs_populate(struct mtd_info *mtd)
 {
-	struct mtd_info *master = mtd_get_master(mtd);
 	struct device *dev = &mtd->dev;
-	struct dentry *root;
 
 	if (IS_ERR_OR_NULL(dfs_dir_mtd))
 		return;
 
-	root = debugfs_create_dir(dev_name(dev), dfs_dir_mtd);
-	mtd->dbg.dfs_dir = root;
-
-	if (master->dbg.partid)
-		debugfs_create_file("partid", 0400, root, master,
-				    &mtd_partid_debug_fops);
-
-	if (master->dbg.partname)
-		debugfs_create_file("partname", 0400, root, master,
-				    &mtd_partname_debug_fops);
+	mtd->dbg.dfs_dir = debugfs_create_dir(dev_name(dev), dfs_dir_mtd);
 }
 
 #ifndef CONFIG_MMU
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 1b3fc8c71ab3..151607e9d64a 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -188,9 +188,6 @@ struct module;	/* only needed for owner field in mtd_info */
  */
 struct mtd_debug_info {
 	struct dentry *dfs_dir;
-
-	const char *partname;
-	const char *partid;
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mtd: core: Remove partid and partname debugfs files
  2022-02-25 14:46 [PATCH v2] mtd: core: Remove partid and partname debugfs files Tudor Ambarus
@ 2022-03-04  7:19 ` Tudor.Ambarus
  2022-03-14 15:59 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Tudor.Ambarus @ 2022-03-04  7:19 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr; +Cc: linux-mtd, linux-kernel, p.yadav

Richard,

I talked with Miquel on irc and said that he would like you to review this patch
before considering it for next. No pressure when, just wanted to ask you if you
can add it to your pending review list.

Cheers,
ta

On 2/25/22 16:46, Tudor Ambarus wrote:
> 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>
> ---
> v2:
> - update commit message
> - collect R-b tag
> 
>  drivers/mtd/mtdcore.c   | 35 +----------------------------------
>  include/linux/mtd/mtd.h |  3 ---
>  2 files changed, 1 insertion(+), 37 deletions(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 1e7f3bbf847e..7dd105daf19d 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -336,28 +336,6 @@ static const struct device_type mtd_devtype = {
>  	.release	= mtd_release,
>  };
>  
> -static int mtd_partid_debug_show(struct seq_file *s, void *p)
> -{
> -	struct mtd_info *mtd = s->private;
> -
> -	seq_printf(s, "%s\n", mtd->dbg.partid);
> -
> -	return 0;
> -}
> -
> -DEFINE_SHOW_ATTRIBUTE(mtd_partid_debug);
> -
> -static int mtd_partname_debug_show(struct seq_file *s, void *p)
> -{
> -	struct mtd_info *mtd = s->private;
> -
> -	seq_printf(s, "%s\n", mtd->dbg.partname);
> -
> -	return 0;
> -}
> -
> -DEFINE_SHOW_ATTRIBUTE(mtd_partname_debug);
> -
>  static bool mtd_expert_analysis_mode;
>  
>  #ifdef CONFIG_DEBUG_FS
> @@ -377,23 +355,12 @@ static struct dentry *dfs_dir_mtd;
>  
>  static void mtd_debugfs_populate(struct mtd_info *mtd)
>  {
> -	struct mtd_info *master = mtd_get_master(mtd);
>  	struct device *dev = &mtd->dev;
> -	struct dentry *root;
>  
>  	if (IS_ERR_OR_NULL(dfs_dir_mtd))
>  		return;
>  
> -	root = debugfs_create_dir(dev_name(dev), dfs_dir_mtd);
> -	mtd->dbg.dfs_dir = root;
> -
> -	if (master->dbg.partid)
> -		debugfs_create_file("partid", 0400, root, master,
> -				    &mtd_partid_debug_fops);
> -
> -	if (master->dbg.partname)
> -		debugfs_create_file("partname", 0400, root, master,
> -				    &mtd_partname_debug_fops);
> +	mtd->dbg.dfs_dir = debugfs_create_dir(dev_name(dev), dfs_dir_mtd);
>  }
>  
>  #ifndef CONFIG_MMU
> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
> index 1b3fc8c71ab3..151607e9d64a 100644
> --- a/include/linux/mtd/mtd.h
> +++ b/include/linux/mtd/mtd.h
> @@ -188,9 +188,6 @@ struct module;	/* only needed for owner field in mtd_info */
>   */
>  struct mtd_debug_info {
>  	struct dentry *dfs_dir;
> -
> -	const char *partname;
> -	const char *partid;
>  };
>  
>  /**


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mtd: core: Remove partid and partname debugfs files
  2022-02-25 14:46 [PATCH v2] mtd: core: Remove partid and partname debugfs files Tudor Ambarus
  2022-03-04  7:19 ` Tudor.Ambarus
@ 2022-03-14 15:59 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2022-03-14 15:59 UTC (permalink / raw)
  To: Tudor Ambarus, miquel.raynal, richard, vigneshr
  Cc: linux-mtd, linux-kernel, Pratyush Yadav

On Fri, 2022-02-25 at 14:46:56 UTC, Tudor Ambarus wrote:
> 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>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-14 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 14:46 [PATCH v2] mtd: core: Remove partid and partname debugfs files Tudor Ambarus
2022-03-04  7:19 ` Tudor.Ambarus
2022-03-14 15:59 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®