[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <74791252.3504.181f0f6cb6a.Coremail.windhl@126.com>
Date: Tue, 12 Jul 2022 13:51:54 +0800 (CST)
From: "Liang He" <windhl@....com>
To: "Jakub Kicinski" <kuba@...nel.org>
Cc: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
netdev@...r.kernel.org
Subject: Re:Re: [PATCH v2] net: ftgmac100: Hold reference returned by
of_get_child_by_name()
At 2022-07-12 10:58:07, "Jakub Kicinski" <kuba@...nel.org> wrote:
>On Sun, 10 Jul 2022 10:07:28 +0800 Liang He wrote:
>> +static inline struct device_node *ftgmac100_has_child_node(struct device_node *np, const char *name)
>> +{
>> + struct device_node *child_np = of_get_child_by_name(np, "mdio");
>> +
>> + of_node_put(child_np);
>> +
>> + return child_np;
>
>Could you make the return type bool ? We don't have a reference on
>the child_no node, we should probably not return the pointer.
>
>Also the "inline" keyword is unnecessary the compiler will inline
>a small, static function with a single caller, anyway.
Thanks, I will prepare the new version patch.
Powered by blists - more mailing lists