public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <p.yadav@ti.com>
Cc: <miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com>,
	<zhuohao@chromium.org>, <michael@walle.cc>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mtd: core: Remove partid and partname debugfs files
Date: Mon, 20 Dec 2021 13:23:00 +0000	[thread overview]
Message-ID: <25999218-8985-03fc-c53d-21bd2a25d365@microchip.com> (raw)
In-Reply-To: <20211220130743.jil62qbyb5lgds6p@ti.com>

On 12/20/21 3:07 PM, Pratyush Yadav wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On 17/12/21 02:26PM, Tudor Ambarus wrote:
>> partid and partname debugfs file are no longer used in mtd, remove

s/file/files

>> dead code.
> 
> Hmm, spi-nor was the only user? Quick grepping does confirm that.

Yes.

> 
>>
>> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
>> ---
>>  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 9186268d361b..1977755fc955 100644
>> --- a/drivers/mtd/mtdcore.c
>> +++ b/drivers/mtd/mtdcore.c
>> @@ -336,49 +336,16 @@ 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 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);
> 
> What is the point of having creating the directory if there is not going
> to be anything in it at all? I think we should drop the entire thing if
There will be files in it: mtdswap_stats, nandsim_wear_report, docg3 files.

$ git grep dbg.dfs_dir drivers/mtd/
drivers/mtd/devices/docg3.c:    struct dentry *root = floor->dbg.dfs_dir;
drivers/mtd/mtdcore.c:  mtd->dbg.dfs_dir = root;
drivers/mtd/mtdcore.c:          debugfs_remove_recursive(mtd->dbg.dfs_dir);
drivers/mtd/mtdswap.c:  struct dentry *root = d->mtd->dbg.dfs_dir;
drivers/mtd/nand/raw/nandsim.c: struct dentry *root = nsmtd->dbg.dfs_dir;
drivers/mtd/ubi/debug.c:                debugfs_remove_recursive(ubi->dbg.dfs_dir);
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-12-20 13:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 12:26 [PATCH 0/2] mtd: core: Remove partid and partname debugfs files Tudor Ambarus
2021-12-17 12:26 ` [PATCH 1/2] mtd: spi-nor: Remove debugfs entries that duplicate sysfs entries Tudor Ambarus
2021-12-20 12:59   ` Pratyush Yadav
2021-12-17 12:26 ` [PATCH 2/2] mtd: core: Remove partid and partname debugfs files Tudor Ambarus
2021-12-20 13:07   ` Pratyush Yadav
2021-12-20 13:23     ` Tudor.Ambarus [this message]
2021-12-20 19:05       ` Pratyush Yadav
2021-12-20 13:05 ` [PATCH 0/2] " Michael Walle
2021-12-29  8:27 ` (subset) " Tudor Ambarus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25999218-8985-03fc-c53d-21bd2a25d365@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.yadav@ti.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=zhuohao@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox