• Anton Vorontsov's avatar
    of: of_parse_phandles_with_args() learns to differentiate 'hole' cells · 7736a3db
    Anton Vorontsov authored
    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: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    7736a3db
base.c 15.8 KB