From: j.anaszewski@samsung•com (Jacek Anaszewski)
To: linux-arm-kernel@lists•infradead.org
Subject: [RESEND PATCH 1/4] leds: leds-ns2: move LED modes mapping outside of the driver
Date: Wed, 24 Jun 2015 09:34:45 +0200 [thread overview]
Message-ID: <558A5D95.9040807@samsung.com> (raw)
In-Reply-To: <20150623181203.GE4853@kw.sim.vm.gnt>
Hi Simon,
On 06/23/2015 08:12 PM, Simon Guinot wrote:
[...]
>
>>> + led = leds;
>>> for_each_child_of_node(np, child) {
>>> const char *string;
>>> - int ret;
>>> + int ret, i, num_modes;
>>> + struct ns2_led_modval *modval;
>>>
>>> ret = of_get_named_gpio(child, "cmd-gpio", 0);
>>> if (ret < 0)
>>> return ret;
>>> - leds[i].cmd = ret;
>>> + led->cmd = ret;
>>> ret = of_get_named_gpio(child, "slow-gpio", 0);
>>> if (ret < 0)
>>> return ret;
>>> - leds[i].slow = ret;
>>> + led->slow = ret;
>>> ret = of_property_read_string(child, "label", &string);
>>> - leds[i].name = (ret == 0) ? string : child->name;
>>> + led->name = (ret == 0) ? string : child->name;
>>> ret = of_property_read_string(child, "linux,default-trigger",
>>> &string);
>>> if (ret == 0)
>>> - leds[i].default_trigger = string;
>>> + led->default_trigger = string;
>>> +
>>> + ret = of_property_count_u32_elems(child, "modes-map");
>>
>> I think that we shouldn't fail if the property is absent, but default
>> to the mapping that is currently hard coded in the driver. Otherwise
>> we would break existing users.
>
> I don't think there is a risk of breaking existing users. On platforms
> where the leds-ns2 driver is used, DTB will be updated with the kernel
> image. Moreover, removing the hard coded mapping is a nice clean-up.
>
> Let me know if you still want me to add a fallback.
Since you modify also dts file in this patch set this is OK.
You can keep this part as is.
--
Best Regards,
Jacek Anaszewski
next prev parent reply other threads:[~2015-06-24 7:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 15:17 [RESEND PATCH 0/4] Allow to use leds-ns2 with n090401 boards Simon Guinot
2015-06-18 15:17 ` [RESEND PATCH 1/4] leds: leds-ns2: move LED modes mapping outside of the driver Simon Guinot
2015-06-22 14:32 ` Jacek Anaszewski
2015-06-23 18:12 ` Simon Guinot
2015-06-24 7:34 ` Jacek Anaszewski [this message]
2015-06-18 15:17 ` [RESEND PATCH 2/4] ARM: Kirkwood: add modes-map property to ns2-leds nodes Simon Guinot
2015-06-18 15:17 ` [RESEND PATCH 3/4] leds: leds-ns2: handle can_sleep GPIOs Simon Guinot
2015-06-22 14:33 ` Jacek Anaszewski
2015-06-24 14:18 ` Jacek Anaszewski
2015-06-26 17:10 ` Simon Guinot
2015-06-29 14:25 ` Jacek Anaszewski
2015-06-29 14:41 ` Simon Guinot
2015-06-18 15:17 ` [RESEND PATCH 4/4] leds: leds-ns2: depends on MACH_ARMADA_370 Simon Guinot
2015-06-22 14:33 ` Jacek Anaszewski
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=558A5D95.9040807@samsung.com \
--to=j.anaszewski@samsung$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/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