From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Sakari Ailus <sakari.ailus@iki.fi>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org
Cc: javier@dowhile0.org, linux-leds@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2.1 2/3] leds: as3645a: Add LED flash class driver
Date: Mon, 21 Aug 2017 21:03:47 +0200 [thread overview]
Message-ID: <cadbcd5b-ad5b-4c6c-8360-1f59aa2e5bf4@gmail.com> (raw)
In-Reply-To: <07392419-c586-a791-a994-bed39f73da94@iki.fi>
Hi Sakari,
On 08/21/2017 03:53 PM, Sakari Ailus wrote:
> Hi Jacek,
>
> Jacek Anaszewski wrote:
>> Hi Sakari,
>>
>> Thanks for the update.
>> I've noticed that you added node labels to the child device nodes
>> in [0]:
>>
>> "as3645a_flash : flash" and "as3645a_indicator : indicator"
>
> The phandle references (as3645a_flash and as3645a_indicator) should
> actually be moved to the patch adding the flash property to the sensor
> device node. It doesn't do anything here, yet.
>
>>
>> I am still seeing problems with this approach:
>>
>> 1) AFAIK these labels are only used for referencing nodes inside dts
>> files and they don't affect the name property of struct device_node
>
> That's right.
>
>> 2) Even if you changed the node name from flash to as3645a_flash, you
>> would get weird LED class device name "as3645a_flash:flash" in case
>> label property is absent. Do you have any objections against the
>> approach I proposed in the previous review?:
>>
>>
>> snprintf(names->flash, sizeof(names->flash),
>> AS_NAME":%s", node->name);
>
> In the current patch, the device node of the flash controller is used,
> postfixed with colon and the name of the LED ("flash" or "indicator") if
> no label is defined. In other words, with that DT source you'll have
> "as3645a:flash" and "as3645a:indicator". So if you change the name of
> the device node of the I²C device, that will be reflected in the label.
>
> If a label exists, then the label is used as such.
>
> I don't really have objections to what you're proposing as such but my
> question is: is it useful? With that, the flash and indicator labels
> will not come from DT if label properties are undefined. They'll always
> be "as3645a:flash" and "as3645a:indicator", independently of the names
> of the device nodes.
>
Ah, indeed, the node->name is put in place of devicename segment and
the node points to the LED controller node. Neat approach, likely to
be adopted as a pattern from now on for all new LED class drivers.
For the patch going through media tree:
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2017-08-21 19:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-19 21:24 [PATCH v2 0/3] AS3645A flash support Sakari Ailus
2017-08-19 21:24 ` [PATCH v2 1/3] dt: bindings: Document DT bindings for Analog devices as3645a Sakari Ailus
2017-08-22 18:34 ` Jacek Anaszewski
[not found] ` <20170819212410.3084-2-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-08-23 0:28 ` Rob Herring
2017-08-23 7:33 ` Sakari Ailus
2017-08-28 10:33 ` Pavel Machek
2017-08-28 10:48 ` Sakari Ailus
2017-08-28 11:09 ` Pavel Machek
[not found] ` <20170819212410.3084-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-08-19 21:24 ` [PATCH v2 2/3] leds: as3645a: Add LED flash class driver Sakari Ailus
2017-08-19 21:42 ` [PATCH v2.1 " Sakari Ailus
2017-08-20 10:09 ` Jacek Anaszewski
2017-08-20 10:12 ` Jacek Anaszewski
[not found] ` <fc6c7893-863b-53ff-48e3-d14297364e5d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-21 13:53 ` Sakari Ailus
2017-08-21 19:03 ` Jacek Anaszewski [this message]
2017-08-21 20:59 ` Sakari Ailus
2017-08-19 21:24 ` [PATCH v2 3/3] arm: dts: omap3: N9/N950: Add AS3645A camera flash Sakari Ailus
2017-08-21 19:57 ` [PATCH v2.1 " Sakari Ailus
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=cadbcd5b-ad5b-4c6c-8360-1f59aa2e5bf4@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=javier@dowhile0.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=sakari.ailus@linux.intel.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;
as well as URLs for NNTP newsgroup(s).