All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Zhuohao Lee <zhuohao@chromium.org>
Cc: "Nicolas Boichat" <drinkcat@chromium.org>,
	bbrezillon@kernel.org, richard@nod.at,
	"Brian Norris" <briannorris@chromium.org>,
	"Marek Vašut" <marek.vasut@gmail.com>,
	linux-mtd@lists.infradead.org,
	"Brian Norris" <computersforpeace@gmail.com>,
	"David Woodhouse" <dwmw2@infradead.org>
Subject: Re: [PATCH v2] mtd: spi-nor: add debugfs nodes for querying the flash name and id
Date: Tue, 7 May 2019 17:10:38 +0200	[thread overview]
Message-ID: <20190507171038.0413678f@collabora.com> (raw)
In-Reply-To: <CABD5ybk+NFsVtdg06=s=iGczoCe2e2s1M+yWZMaUix02uggnrQ@mail.gmail.com>

On Tue, 7 May 2019 23:06:32 +0800
Zhuohao Lee <zhuohao@chromium.org> wrote:


> > > > > @@ -231,8 +231,11 @@ static int m25p_probe(struct spi_mem *spimem)  
> > > >
> > > > Can we add this to function that is generic to all spi-nor devices,
> > > > instead of making this specific to m25p?  
> > > I can't find a better way to insert the spi_nor_debugfs_create()
> > > inside spi_nor.c.
> > > Another way is adding spi_nor_debugfs_create() to all of the caller.
> > > What do you think? Any other suggestion?  
> >
> > That, or maybe create a new spi_nor_device_register that does both
> > mtd_device_register and that spi_nor_debugfs_create call?  
> Thanks for suggestion. I feel that putting the mtd_device_register
> (high level api) inside the spi-nor (low level api)
> isn't perfect. This also will limit the caller to call this api to
> register mtd device with debugfs and lost the flexibility.
> I'll keep the original idea that adding spi_nor_debugfs_create() to
> all of the caller.

Why don't you move that to the MTD layer? If you add partname/partid
fields to mtd_info you'll have everything you need to make that generic.
It's then up to the upper layer to fill those fields before calling
mtd_device_register().


> > > >  
> > > > > +               return;
> > > > > +       }
> > > > > +       debugfs_create_file("flashid", S_IRUSR, root, nor,
> > > > > +                       &flashid_dbg_fops);
> > > > > +       debugfs_create_file("flashname", S_IRUSR, root, nor,
> > > > > +                       &flashname_dbg_fops);  

I thought we agreed on partname/partid. Any reason for switching back
to flashname/flashid?

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-05-07 15:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06  8:44 [PATCH v2] mtd: spi-nor: add debugfs nodes for querying the flash name and id Zhuohao Lee
2019-05-06  8:47 ` Zhuohao Lee
2019-05-06  9:07 ` Nicolas Boichat
2019-05-06 11:36   ` Zhuohao Lee
2019-05-07  2:11     ` Nicolas Boichat
2019-05-07 15:06       ` Zhuohao Lee
2019-05-07 15:10         ` Boris Brezillon [this message]
2019-05-08  9:12           ` Zhuohao Lee

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=20190507171038.0413678f@collabora.com \
    --to=boris.brezillon@collabora.com \
    --cc=bbrezillon@kernel.org \
    --cc=briannorris@chromium.org \
    --cc=computersforpeace@gmail.com \
    --cc=drinkcat@chromium.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.