Hi Timur,
On 2015年01月10日 06:08, Timur Tabi wrote:
On Mon, Nov 10, 2014 at 8:47 PM, al.stone@linaro.org wrote:
+int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
const char *propname, char **val,
size_t nval)
+{
if (is_of_node(fwnode))
return of_property_read_string_array(of_node(fwnode), propname,
val, nval);
I figured someone would have noticed this already, but I don't see any posts on the subject. The above code causes this build warning:
drivers/base/property.c: In function ‘fwnode_property_read_string_array’: drivers/base/property.c:561:12: warning: passing argument 3 of ‘of_property_read_string_array’ from incompatible pointer type [enabled by default] val, nval); ^ In file included from drivers/base/property.c:16:0: include/linux/of.h:748:19: note: expected ‘const char **’ but argument is of type ‘char **’ static inline int of_property_read_string_array(struct device_node *np, ^
The 'val' parameter is "char **", but of_property_read_string_array() has this prototype:
static inline int of_property_read_string_array(struct device_node *np, const char *propname, const char **out_strs, size_t sz)
code in mainline (3.19) already fixed this problem:
/** * fwnode_property_read_string_array - return string array property of a node * @fwnode: Firmware node to get the property of * @propname: Name of the property * @val: The values are stored here * @nval: Size of the @val array * * Read an string list property @propname from the given firmware node and store * them to @val if found. * * Return: %0 if the property was found (success), * %-EINVAL if given arguments are not valid, * %-ENODATA if the property does not have a value, * %-EPROTO if the property is not an array of strings, * %-EOVERFLOW if the size of the property is not as expected, * %-ENXIO if no suitable firmware interface is present. */ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, const char *propname, const char **val, size_t nval)
Thanks Hanjun