mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Kerello <christophe.kerello@st.com>
To: Steve deRosier <derosier@gmail.com>
Cc: <miquel.raynal@bootlin.com>, Richard Weinberger <richard@nod.at>,
	<vigneshr@ti.com>, linux-mtd <linux-mtd@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: mtd: Use mtd device name instead of mtd->name when registering nvmem device
Date: Mon, 25 Nov 2019 17:34:28 +0100	[thread overview]
Message-ID: <e7801419-1644-d768-4186-ab4f17151980@st.com> (raw)
In-Reply-To: <CALLGbRJ00TeZKPfhkqj_mwu9zhMzc_+A8mh4uwaPnFBUatrwTw@mail.gmail.com>



On 11/25/19 5:05 PM, Steve deRosier wrote:
> On Fri, Nov 22, 2019 at 9:04 AM Christophe Kerello
> <christophe.kerello@st.com> wrote:
>>
>> MTD currently allows to have same partition name on different devices.
>> Since nvmen device registration has been added, it is not more possible
>> to have same partition name on different devices. We get following
>> logs:
>> sysfs: cannot create duplicate filename XXX
>> Failed to register NVMEM device
>>
>> To avoid such issue, the proposed patch uses the mtd device name instead of
>> the partition name.
> ...
>> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
>> index 5fac435..559b693 100644
>> --- a/drivers/mtd/mtdcore.c
>> +++ b/drivers/mtd/mtdcore.c
>> @@ -551,7 +551,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
>>
>>          config.id = -1;
>>          config.dev = &mtd->dev;
>> -       config.name = mtd->name;
>> +       config.name = dev_name(&mtd->dev);
>>          config.owner = THIS_MODULE;
>>          config.reg_read = mtd_nvmem_reg_read;
>>          config.size = mtd->size;
> 
> This would be a breaking change for anyone that depended on
> `config.name = mtd->name` behavior. Obviously, if they were using
> multiple devs with the same partition name as you were, they'd have
> already been broken, but I suspect if a lot of people were doing that
> we'd have heard about that before now.

Hi Steve,

I understand your concern. So the recommendation is to have unique 
partition names.

Regards,
Christophe Kerello.

> 
> - Steve
> 

      reply	other threads:[~2019-11-25 16:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 17:03 Christophe Kerello
2019-11-25 15:05 ` Miquel Raynal
2019-11-25 15:37   ` Miquel Raynal
2019-11-28 15:52     ` Christophe Kerello
2019-11-25 16:05 ` Steve deRosier
2019-11-25 16:34   ` Christophe Kerello [this message]

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=e7801419-1644-d768-4186-ab4f17151980@st.com \
    --to=christophe.kerello@st.com \
    --cc=derosier@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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

all inboxes | Powered by JetHome®