From: Daniel Mack <zonque@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, broonie@kernel.org,
grant.likely@linaro.org, agust@denx.de, chf@fritzc.com
Subject: Re: [PATCH RESEND v2 2/2] Input: touchscreen: ads7846: add device tree bindings
Date: Mon, 01 Jul 2013 08:52:28 +0200 [thread overview]
Message-ID: <51D1272C.2020905@gmail.com> (raw)
In-Reply-To: <20130701013537.GB10755@core.coreip.homeip.net>
Hi Dmirty,
On 01.07.2013 03:35, Dmitry Torokhov wrote:
> On Sun, Jun 30, 2013 at 11:09:15PM +0200, Daniel Mack wrote:
>> +static struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
>> +{
>> + struct ads7846_platform_data *pdata = NULL;
>> + const struct of_device_id *match;
>> + u32 val;
>> +
>> + match = of_match_device(ads7846_dt_ids, dev);
>> + if (!match)
>> + return NULL;
>> +
>> + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>> + if (!pdata)
>> + return NULL;
>> +
>> + pdata->model = (unsigned int) match->data;
>
> The pointer is long so this conversion does generate compile warnings.
>
>> +
>> + if (of_property_read_u32(dev->of_node, "ti,vref-delay-usecs", &val) == 0)
>> + pdata->vref_delay_usecs = val;
>
> Why don't we use u16 properties to match the platform data?
>
> How about the version of the patch below?
Yes, that should work as well, and it looks cleaner. Feel free to commit
your version :) As I said - I don't have access to the hardware anymore,
so I can't give it a real test right now.
Thanks,
Daniel
next prev parent reply other threads:[~2013-07-01 6:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-30 21:09 [PATCH RESEND v2 1/2] Input: touchscreen: ads7846: keep copy of pdata in private struct Daniel Mack
2013-06-30 21:09 ` [PATCH RESEND v2 2/2] Input: touchscreen: ads7846: add device tree bindings Daniel Mack
2013-07-01 1:35 ` Dmitry Torokhov
2013-07-01 3:12 ` Dmitry Torokhov
2013-07-01 6:52 ` Daniel Mack [this message]
2013-07-01 1:33 ` [PATCH RESEND v2 1/2] Input: touchscreen: ads7846: keep copy of pdata in private struct Dmitry Torokhov
2013-07-01 6:48 ` Daniel Mack
2013-07-01 7:09 ` Dmitry Torokhov
2013-07-01 7:14 ` Daniel Mack
2013-07-01 7:21 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2013-05-22 17:57 Daniel Mack
2013-05-22 17:58 ` [PATCH RESEND v2 2/2] Input: touchscreen: ads7846: add device tree bindings Daniel Mack
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=51D1272C.2020905@gmail.com \
--to=zonque@gmail.com \
--cc=agust@denx.de \
--cc=broonie@kernel.org \
--cc=chf@fritzc.com \
--cc=dmitry.torokhov@gmail.com \
--cc=grant.likely@linaro.org \
--cc=linux-input@vger.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;
as well as URLs for NNTP newsgroup(s).