Thread (8 messages) flat view 8 messages, 3 authors, 2017-01-25

Re: [PATCH v5 3/3] watchdog: zx2967: add watchdog controller driver for ZTE's zx2967 family

From: Baoyou Xie <hidden>
Date: 2017-01-25 02:47:26
Also in: linux-watchdog

On 25 January 2017 at 10:43, Guenter Roeck [off-list ref] wrote:
On 01/24/2017 06:16 PM, Baoyou Xie wrote:
quoted
[ ... ]
quoted
        +
        +       ret = of_parse_phandle_with_fixed_args(dev->of_node,
        +                       "zte,wdt-reset-sysctrl", 3, 0, &out_args);
        +       if (ret)
        +               return;
        +
        +       offset = out_args.args[0];
        +       config = out_args.args[1];
        +       mask = out_args.args[2];
        +
        +       regmap = syscon_node_to_regmap(out_args.np <
http://out_args.np>);
        +       if (IS_ERR(regmap))
        +               return;
        +
        +       regmap_update_bits(regmap, offset, mask, config);


    Another comment suggested adding
            of_node_put(out_args.np <http://out_args.np>);
    here.


is it really? most of the driver that call this function don't call
of_node_put. but it seems harmless to call of_node_put.


Even if everyone else is doing things wrong, that doesn't mean
that you should do the same, nor is it a good idea to use it
as argument.

en, yes.
I have read the comment of of_parse_phandle_with_fixed_args. in v6 version,
I have fixed it.
thanks.

Guenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help