]> git.baikalelectronics.ru Git - kernel.git/commit
of: of_parse_phandles_with_args() learns to differentiate 'hole' cells
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Fri, 5 Dec 2008 08:15:46 +0000 (08:15 +0000)
committerPaul Mackerras <paulus@samba.org>
Sun, 21 Dec 2008 03:21:14 +0000 (14:21 +1100)
commit1ed699a98a1f02b08c1ee99ec5ea97dc297de50c
tree27ab46e431b71294c24dbbf721bdbc581f977f14
parent9c4fd8cb3bdd52ae630b1c686b7de7c4a911cb15
of: of_parse_phandles_with_args() learns to differentiate 'hole' cells

Given this list (contains three gpio specifiers, one of which is a hole):

gpios = <&phandle1 1 2 3
         0 /* a hole */
         &phandle2 4 5 6>;

of_parse_phandles_with_args() would report -ENOENT for the `hole'
specifier item, the same error value is used to report the end of the
list, for example.

Sometimes we want to differentiate holes from real errors -- for
example when we want to count all the [syntax correct] specifiers.

With this patch of_parse_phandles_with_args() will report -EEXITS when
somebody requested to parse a hole.

Also, make the out_{node,args} arguments optional, when counting we
don't really need the out values.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
drivers/of/base.c