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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html