From: Mark Rutland <mark.rutland@arm.com>
To: "David Rivshin (Allworx)" <drivshin.allworx@gmail.com>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
Richard Purdie <rpurdie@rpsys.net>,
Jacek Anaszewski <j.anaszewski@samsung.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Stefan Wahren <stefan.wahren@i2se.com>
Subject: Re: [PATCH RFC 3/3] leds: Add driver for the ISSI IS31FL32xx family of LED drivers
Date: Tue, 23 Feb 2016 18:45:17 +0000 [thread overview]
Message-ID: <20160223184517.GB10246@leverpostej> (raw)
In-Reply-To: <1456251445-23970-4-git-send-email-drivshin.allworx@gmail.com>
On Tue, Feb 23, 2016 at 01:17:25PM -0500, David Rivshin (Allworx) wrote:
> From: David Rivshin <drivshin@allworx.com>
> +static int is31fl32xx_parse_child_dt(const struct device *dev,
> + const struct device_node *child,
> + struct is31fl32xx_led_data *led_data)
> +{
> + struct led_classdev *cdev = &led_data->cdev;
> + int ret = 0;
> + u32 reg;
> +
> + cdev->name = of_get_property(child, "label", NULL) ? : child->name;
We really shouldn't be spreading of_get_property into more drivers. It's
generally not what you want, and doesn't do appropriate sanity checking.
Use of_property_read_string, though you may need to copy the result.
> +
> + ret = of_property_read_u32(child, "reg", ®);
> + if (ret || reg < 1 || reg > led_data->priv->cdef->channels) {
> + dev_err(dev,
> + "Child node %s does not have a valid reg property\n",
> + child->name);
> + return -EINVAL;
> + }
> + led_data->channel = reg;
> +
> + cdev->default_trigger = of_get_property(child, "linux,default-trigger",
> + NULL);
Likewise.
Thanks,
Mark.
next prev parent reply other threads:[~2016-02-23 18:45 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 18:17 [PATCH RFC 0/3] leds: Add driver for the ISSI IS31FL32xx family of LED drivers David Rivshin (Allworx)
2016-02-23 18:17 ` [PATCH RFC 1/3] DT: Add vendor prefix for Integrated Silicon Solutions Inc David Rivshin (Allworx)
2016-02-23 23:36 ` Rob Herring
2016-02-23 18:17 ` [PATCH RFC 2/3] DT: leds: Add binding for the ISSI IS31FL32xx family of LED drivers David Rivshin (Allworx)
2016-02-24 1:15 ` Rob Herring
2016-02-24 18:57 ` David Rivshin (Allworx)
2016-02-24 19:45 ` Rob Herring
2016-02-24 23:16 ` David Rivshin (Allworx)
2016-02-25 1:17 ` Rob Herring
2016-02-24 16:04 ` Jacek Anaszewski
2016-02-24 19:34 ` David Rivshin (Allworx)
2016-02-24 19:49 ` Rob Herring
2016-02-26 0:30 ` David Rivshin (Allworx)
2016-02-26 9:56 ` Jacek Anaszewski
2016-02-23 18:17 ` [PATCH RFC 3/3] leds: Add driver " David Rivshin (Allworx)
2016-02-23 18:45 ` Mark Rutland [this message]
2016-02-23 22:38 ` David Rivshin (Allworx)
2016-02-24 16:08 ` Jacek Anaszewski
2016-02-24 16:04 ` Jacek Anaszewski
2016-02-25 2:24 ` David Rivshin (Allworx)
2016-02-25 10:55 ` Jacek Anaszewski
2016-02-25 19:12 ` David Rivshin (Allworx)
2016-02-26 9:47 ` Jacek Anaszewski
2016-02-26 21:58 ` David Rivshin (Allworx)
2016-02-27 10:48 ` Stefan Wahren
2016-02-29 18:02 ` David Rivshin (Allworx)
2016-02-29 19:40 ` Stefan Wahren
2016-03-01 1:32 ` David Rivshin (Allworx)
2016-02-29 9:47 ` Jacek Anaszewski
2016-02-29 18:26 ` David Rivshin (Allworx)
2016-03-01 8:24 ` Jacek Anaszewski
2016-03-01 18:45 ` David Rivshin (Allworx)
2016-03-02 8:15 ` 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=20160223184517.GB10246@leverpostej \
--to=mark.rutland@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=drivshin.allworx@gmail.com \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=j.anaszewski@samsung.com \
--cc=linux-leds@vger.kernel.org \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=rpurdie@rpsys.net \
--cc=stefan.wahren@i2se.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