Name

of_count_phandle_with_args — find the number of phandles in a property

Synopsis

int of_count_phandle_with_args (const struct device_node * np,
 const char * list_name,
 const char * cells_name);
 

Arguments

np

Pointer to node that contains the phandle list

list_name

Name of property in node np that contains the phandle list

cells_name

Name of property in target node that contains phandle's argument count

Description

It is a typical pattern to encode a list of phandle and variable arguments into a single property. The number of arguments is encoded by a property in the phandle-target node. For example, a gpios property would contain a list of GPIO specifiers consisting of a phandle and 1 or more arguments. The number of arguments are determined by the #gpio-cells property in the node pointed to by the phandle.

Return

The number of phandle + argument tuples within a property on success, -EINVAL if parsing error on list_name.