mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Dan Murphy <dmurphy@ti.com>, Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Pavel Machek <pavel@ucw.cz>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux LED Subsystem <linux-leds@vger.kernel.org>
Subject: Re: [PATCH v6 2/2] leds: lm3601x: Introduce the lm3601x LED driver
Date: Thu, 17 May 2018 23:26:45 +0200	[thread overview]
Message-ID: <f8147f95-b7e3-4a78-90d7-59888b20fd60@gmail.com> (raw)
In-Reply-To: <54dcb6cc-7765-f64c-33fd-2920f3865153@ti.com>

Dan,

On 05/17/2018 04:34 PM, Dan Murphy wrote:
> Jacek
> 
> On 05/16/2018 04:17 PM, Dan Murphy wrote:
> <snip>
> 
>>>>>
>>>>>
>>>>>>>> +               if (!ret)
>>>>>>>
>>>>>>> if (ret) sounds more natural. And better just to split
>>>>>>>
>>>>>>>> +                       snprintf(led->led_name, sizeof(led->led_name),
>>>>>>>> +                               "%s:%s", led->led_node->name, name);
>>>>>>>> +               else
>>>>>>>> +                       snprintf(led->led_name, sizeof(led->led_name),
>>>>>>>> +                               "%s:torch", led->led_node->name);
>>>>>>>
>>>>>>> const char *tmp;
>>>>>>>
>>>>>>> ret = device_property_read_...(&tmp);
>>>>>>> if (ret)
>>>>>>>    tmp = ...
>>>>>>> sprintf(...);
>>>>
>>>> We're no longer taking devicename section of a LED class device name
>>>> from DT, so it will look differently anyway.
>>>>
> 
> So in adding the device_property code I think we again are reaching the LED label issue.
> In ARM with DT we would take the parent device node name and append it to the label

AFAIR this approach (parent DT node name used for devicename ) was 
incidentally applied in leds-as3645a.c. Soon after that we started
to use led-controller for parent DT name, according to Rob's request.

In the most of LED class drivers this is a child DT node which is used
for devicename, in case label is absent.

> if the optional label property was not available.  In migrating to the device_property
> APIs we don't or can't depend on that parent node anymore.
> 
> So for the case where the label property does not exist should we use a hard coded name
> or should we try to use the name from a device_id table.
> 
> This is how we did this for the leds-lp8860 driver.  If the label did not exist we used the
> i2c_device_id table and pulled the string from there.

i2c_device_id can't be applied as a generic pattern, but only for I2C
hooked devices. Nonetheless since it allows to save few lines of code
in case of drivers supporting a family of chips we can use it.

We are going to get rid of a devicename section from LED class device
name soon anyway, since it is redundant.

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2018-05-17 21:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 15:43 [PATCH v6 1/2] dt: bindings: lm3601x: Introduce the lm3601x driver Dan Murphy
2018-05-15 15:43 ` [PATCH v6 2/2] leds: lm3601x: Introduce the lm3601x LED driver Dan Murphy
2018-05-15 21:24   ` Jacek Anaszewski
2018-05-15 21:50     ` Dan Murphy
2018-05-16 20:43       ` Jacek Anaszewski
2018-05-15 21:56   ` Andy Shevchenko
2018-05-15 22:08     ` Dan Murphy
2018-05-15 22:24       ` Andy Shevchenko
2018-05-15 22:27         ` Andy Shevchenko
2018-05-16 20:43         ` Dan Murphy
2018-05-16 22:11           ` Andy Shevchenko
2018-05-16 22:19             ` Andy Shevchenko
2018-05-16 21:02         ` Jacek Anaszewski
2018-05-16 21:13           ` Dan Murphy
2018-05-16 21:17             ` Dan Murphy
2018-05-16 21:27               ` Jacek Anaszewski
2018-05-17 14:34               ` Dan Murphy
2018-05-17 21:26                 ` Jacek Anaszewski [this message]
2018-05-15 21:13 ` [PATCH v6 1/2] dt: bindings: lm3601x: Introduce the lm3601x driver Jacek Anaszewski
2018-05-15 21:29   ` Dan Murphy
2018-05-16 20:10     ` Jacek Anaszewski
2018-05-16 20:14       ` Dan Murphy
2018-05-18 15:11 ` Rob Herring

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=f8147f95-b7e3-4a78-90d7-59888b20fd60@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@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®