From: Lee Jones <lee.jones@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] mfd: core: Preserve PLATFORM_DEVID_NONE
Date: Fri, 24 Mar 2017 11:35:00 +0000 [thread overview]
Message-ID: <20170324113500.3ceuwwjtknjtwvp3@dell> (raw)
In-Reply-To: <1490274576.19767.189.camel@linux.intel.com>
On Thu, 23 Mar 2017, Andy Shevchenko wrote:
> On Thu, 2017-03-23 at 11:21 +0000, Lee Jones wrote:
> > On Thu, 16 Mar 2017, Andy Shevchenko wrote:
> >
> > > There is a potential flaw if cell has id > 0 and is going to be
> > > registered with PLATFORM_DEVID_NONE.
> > >
> > > Ignore if PLATFORM_DEVID_NONE is supplied.
> >
> > This is a substantial change to a pretty tried and tested piece of
> > sub-system code. Can you put some more meat on the bones in the
> > commit log, and include examples.
>
> Example in pseudo code:
>
> cells = {
> [0] = { .id = 0, .name = "moduleX", },
> [1] = { .id = 1, .name = "moduleY", },
> [2] = { .id = 2, .name = "moduleZ", },
> ...
> };
>
> mfd_add_devices(..., PLATFORM_DEVID_NONE, cells, ARRAY_SIZE(cells),
> ...);
>
> Output (names of the devices in the drivers):
> "moduleX"
> "moduleY.0"
> "moduleX.1"
>
> Desired output:
> "moduleX"
> "moduleY"
> "moduleZ"
Then what would be your reason for populating the 'id' attribute?
> Is it by design?
>
> >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > ---
> > > drivers/mfd/mfd-core.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> > > index c57e407020f1..c9583f895058 100644
> > > --- a/drivers/mfd/mfd-core.c
> > > +++ b/drivers/mfd/mfd-core.c
> > > @@ -149,7 +149,7 @@ static int mfd_add_device(struct device *parent,
> > > int id,
> > > int platform_id;
> > > int r;
> > >
> > > - if (id == PLATFORM_DEVID_AUTO)
> > > + if (id < 0)
> > > platform_id = id;
> > > else
> > > platform_id = id + cell->id;
> >
> >
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2017-03-24 11:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-16 14:19 Andy Shevchenko
2017-03-23 11:21 ` Lee Jones
2017-03-23 13:09 ` Andy Shevchenko
2017-03-24 11:35 ` Lee Jones [this message]
2017-03-26 12:53 ` Andy Shevchenko
2017-03-27 12:41 ` Lee Jones
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=20170324113500.3ceuwwjtknjtwvp3@dell \
--to=lee.jones@linaro.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®