From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>,
linux-leds@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
stewart@linux.vnet.ibm.com, arnd@arndb.de, cooloney@gmail.com,
rpurdie@rpsys.net, khandual@linux.vnet.ibm.com,
mpe@ellerman.id.au, benh@kernel.crashing.org
Subject: Re: [PATCH v6 3/3] leds/powernv: Add driver for PowerNV platform
Date: Mon, 20 Jul 2015 22:25:37 +0530 [thread overview]
Message-ID: <55AD2809.6050007@linux.vnet.ibm.com> (raw)
In-Reply-To: <55AC9244.5010407@gmail.com>
On 07/20/2015 11:46 AM, Jacek Anaszewski wrote:
> On 19.07.2015 23:40, Jacek Anaszewski wrote:
> [...]
>>>>> +/* Platform driver probe */
>>>>> +static int powernv_led_probe(struct platform_device *pdev)
>>>>> +{
>>>>> + int num_leds;
>>>>> + struct device_node *led_node;
>>>>> + struct powernv_leds_priv *priv;
>>>>> +
>>>>> + led_node = of_find_node_by_path("/ibm,opal/leds");
>>>>> + if (!led_node) {
>>>>> + dev_err(&pdev->dev,
>>>>> + "%s: LED parent device node not found\n", __func__);
>>>>> + return -EINVAL;
>>>>> + }
>>>>> +
>>>>> + num_leds = powernv_leds_count(led_node);
>>>>> + if (num_leds <= 0) {
>>>>> + dev_err(&pdev->dev,
>>>>> + "%s: No location code found under LED node\n",
>>>>> + __func__);
>>>>> + return -EINVAL;
>>>>> + }
>>
>> You won't need to count the number of LEDs to register, just allocate
>> memory for each LED during parsing with managed resource allocation
>> API.
Jacek,
>
> You can refer to drivers/leds/leds-bcm6328.c in order to gain
> full picture on how this can look like.
> struct powernv_led_data would have to carry the pointer to the
> new common struct.
>
Sure.. Will though this code and will fix powernv code..
Thanks
-Vasant
next prev parent reply other threads:[~2015-07-20 16:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-17 10:41 [PATCH v6 0/3] LED driver for PowerNV platform Vasant Hegde
2015-07-17 10:41 ` [PATCH v6 1/3] powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states Vasant Hegde
2015-07-17 10:41 ` [PATCH v6 2/3] powerpc/powernv: Create LED platform device Vasant Hegde
2015-07-17 10:41 ` [PATCH v6 3/3] leds/powernv: Add driver for PowerNV platform Vasant Hegde
2015-07-17 15:25 ` Jacek Anaszewski
2015-07-17 16:20 ` Vasant Hegde
2015-07-19 21:40 ` Jacek Anaszewski
2015-07-20 6:16 ` Jacek Anaszewski
2015-07-20 16:55 ` Vasant Hegde [this message]
2015-07-21 5:54 ` Vasant Hegde
2015-07-21 6:55 ` Vasant Hegde
2015-07-21 9:55 ` Jacek Anaszewski
2015-07-21 9:40 ` 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=55AD2809.6050007@linux.vnet.ibm.com \
--to=hegdevasant@linux.vnet.ibm.com \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=cooloney@gmail.com \
--cc=j.anaszewski@samsung.com \
--cc=jacek.anaszewski@gmail.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=linux-leds@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=rpurdie@rpsys.net \
--cc=stewart@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.