From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
Misael Lopez Cruz <misael.lopez@ti.com>,
Benoit Cousson <b-cousson@ti.com>,
devicetree-discuss@lists.ozlabs.org, Liam Girdwood <lrg@ti.com>
Subject: Re: [PATCH] Input: tl6040-vibra: Device Tree support
Date: Mon, 7 May 2012 08:48:26 -0700 [thread overview]
Message-ID: <20120507154826.GB10222@core.coreip.homeip.net> (raw)
In-Reply-To: <4FA7A8B9.4040208@ti.com>
On Mon, May 07, 2012 at 01:49:29PM +0300, Peter Ujfalusi wrote:
> Hi Dmitry,
>
> On 05/07/2012 10:02 AM, Dmitry Torokhov wrote:
> > Hi Peter,
> >
> > On Fri, May 04, 2012 at 03:05:13PM +0300, Peter Ujfalusi wrote:
> >> + if (pdata) {
> >> + info->vibldrv_res = pdata->vibldrv_res;
> >> + info->vibrdrv_res = pdata->vibrdrv_res;
> >> + info->viblmotor_res = pdata->viblmotor_res;
> >> + info->vibrmotor_res = pdata->vibrmotor_res;
> >> + vddvibl_uV = pdata->vddvibl_uV;
> >> + vddvibr_uV = pdata->vddvibr_uV;
> >> + } else {
> >> + of_property_read_u32(node, "vibldrv_res", &info->vibldrv_res);
> >> + of_property_read_u32(node, "vibrdrv_res", &info->vibrdrv_res);
> >> + of_property_read_u32(node, "viblmotor_res",
> >> + &info->viblmotor_res);
> >> + of_property_read_u32(node, "vibrmotor_res",
> >> + &info->vibrmotor_res);
> >
> > Since these 4 appear to be mandatory properties don't we need to
> > validate they are actually present in DT?
>
> If the property does not exist in the DT blob the variable will not be
> updated - it will remain 0.
> I have kept the validity check for the resistance values. This will
> catch the case when something is missing from the DT blob.
>
> I just did not wanted to complicate the code with additional checks
> since the end result would be the same.
Ah, indeed, I missed that we still validate the values.
Applied, thanks Peter.
--
Dmitry
prev parent reply other threads:[~2012-05-07 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-04 12:05 Peter Ujfalusi
2012-05-07 7:02 ` Dmitry Torokhov
2012-05-07 10:49 ` Peter Ujfalusi
2012-05-07 15:48 ` Dmitry Torokhov [this message]
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=20120507154826.GB10222@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=b-cousson@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=misael.lopez@ti.com \
--cc=peter.ujfalusi@ti.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
all inboxes | Powered by JetHome®