Messages in this thread | | | From | "Rafael J. Wysocki" <> | Subject | Re: [PATCH v2 0/2] pinctrl: Intel Cherryview/Braswell support | Date | Wed, 05 Nov 2014 00:00:35 +0100 |
| |
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
| |