lkml.org 
[lkml]   [2014]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 0/2] pinctrl: Intel Cherryview/Braswell support
Date
On Tuesday, November 04, 2014 04:32:54 PM Timur Tabi wrote:
> On 11/04/2014 04:47 PM, Rafael J. Wysocki wrote:
> > What exactly do you need the size of the property alone for?
>
> There are lots of situations where you don't know the size of the
> property in advance (e.g. strings), and drivers use of_find_property()
> or of_get_property() to pre-allocate a buffer or to verify that the
> property is correctly formed in the device tree.

The problem is that in ACPI properties are not contiguous buffers full
of data. They generally have internal structure.

But device_property_read_string(), for example, gives you a pointer to
the value of the property and you can check the size of that just fine
using strlen(). Isn't that sufficient?

Rafael



\
 
 \ /
  Last update: 2014-11-05 00:01    [W:1.499 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site