Subject: Re: [PATCH v2] net: ftgmac100: Hold reference returned by of_get_child_by_name()

From: Jakub Kicinski <[email-masked]>
Date: Mon, 11 Jul 2022 19:58:07 -0700

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.