From: Mika Westerberg <mika.westerberg@linux•intel.com>
To: Grant Likely <grant.likely@secretlab•ca>
Cc: Fabio Estevam <festevam@gmail•com>,
Jean-Michel Hautbois <jean-michel.hautbois@vodalys•com>,
linux-next <linux-next@vger•kernel.org>,
linux-kernel <linux-kernel@vger•kernel.org>,
Fabio Estevam <fabio.estevam@freescale•com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel•com>,
Bryan Wu <cooloney@gmail•com>
Subject: Re: DT parsing : duplicate name error
Date: Wed, 3 Dec 2014 19:10:57 +0200 [thread overview]
Message-ID: <20141203171057.GD28857@lahna.fi.intel.com> (raw)
In-Reply-To: <CACxGe6s-dKRtwjBhVE2d1L-qOYX_71hQOT9svu4m_+kDZESPaw@mail.gmail.com>
On Wed, Dec 03, 2014 at 04:07:58PM +0000, Grant Likely wrote:
> On Wed, Dec 3, 2014 at 4:04 PM, Fabio Estevam <festevam@gmail•com> wrote:
> > On Wed, Dec 3, 2014 at 1:41 PM, Grant Likely <grant.likely@secretlab•ca> wrote:
> >
> >> From a quick reading of the backlog, for some reason the new device is
> >> getting assigned NULL as the device name in led_classdev_register().
> >> Probably because led_cdev->name is set to NULL. The leds are getting
> >> bound to the LED driver in gpio_led_probe() which is the non-DT path
> >> for creating LED devices. That would mean there is pdata attached to
> >> the LED device, but I haven't dug any farther than that. Really need
> >> the bisect to narrow down what is going on.
> >
> > Ok, so this issue happens when two or more gpio-leds do not contain
> > the 'label' property.
> >
> > 'label' is an optional property according to
> > Documentation/devicetree/bindings/leds/common.txt:
> >
> > "Optional properties for child nodes:
> > - label : The label for this LED. If omitted, the label is
> > taken from the node name (excluding the unit address)."
> >
> > This works fine on 3.17.1 as we used to have this logic in leds-gpio:
> > led.name = of_get_property(child, "label", NULL) ? : child->name;
> >
> > ,but since commit a43f2cbbb009f96 ("leds: leds-gpio: Make use of
> > device property API "), this is no longer true:
> >
> > + fwnode_property_read_string(child, "label", &led.name);
> >
> > If 'label' is not present then both of the LEDs will have the same
> > name and then the duplicate name error will happen.
> >
> > So we would need something like this:
> >
> > if (fwnode_property_present(child, "label"))
> > fwnode_property_read_string(child, "label", &led.name);
> > else
> > get the name from the child ---> This is what I am not sure how
> > to do after the conversion to use fwnode_handle.
>
> Ah, that makes sense. The device properties change needs to be
> reworked/fixed up to have a DT specific part when the label property
> is missing. Either that or the device properties API needs to gain the
> ability to return the node name.
Does it need to be taken from the node name? What if we generate the
name based on the leds device name?
Something like "leds-gpio:0" and "leds-gpio:1" or so.
prev parent reply other threads:[~2014-12-03 17:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 13:27 DT parsing : duplicate name error Jean-Michel Hautbois
2014-12-03 15:22 ` Grant Likely
2014-12-03 15:23 ` Jean-Michel Hautbois
2014-12-03 15:41 ` Grant Likely
2014-12-03 16:04 ` Fabio Estevam
2014-12-03 16:07 ` Grant Likely
2014-12-03 16:09 ` Jean-Michel Hautbois
2014-12-03 17:06 ` Fabio Estevam
2014-12-03 17:10 ` Mika Westerberg [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=20141203171057.GD28857@lahna.fi.intel.com \
--to=mika.westerberg@linux$(echo .)intel.com \
--cc=cooloney@gmail$(echo .)com \
--cc=fabio.estevam@freescale$(echo .)com \
--cc=festevam@gmail$(echo .)com \
--cc=grant.likely@secretlab$(echo .)ca \
--cc=jean-michel.hautbois@vodalys$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=rafael.j.wysocki@intel$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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