[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxSCdYPjv13Rv_JV@google.com>
Date: Sat, 19 Oct 2024 21:09:25 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>
Cc: Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Hans de Goede <hdegoede@...hat.com>, Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
linux-rpi-kernel@...ts.infradead.org
Subject: Re: [PATCH 05/10] Input: twl4030-vibra - use cleanup facility for
device_node
On Thu, Oct 10, 2024 at 11:25:55PM +0200, Javier Carrasco wrote:
> Use the '__free(device_node)' macro to simplify the code by
> automatically freeing the device node.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
> ---
> drivers/input/misc/twl4030-vibra.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
> index 101548b35ee3..b8ec5c7c5bce 100644
> --- a/drivers/input/misc/twl4030-vibra.c
> +++ b/drivers/input/misc/twl4030-vibra.c
> @@ -165,15 +165,10 @@ static DEFINE_SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
>
> static bool twl4030_vibra_check_coexist(struct device_node *parent)
> {
> - struct device_node *node;
> + struct device_node *node __free(device_node) =
> + of_get_child_by_name(parent, "codec");
>
> - node = of_get_child_by_name(parent, "codec");
> - if (node) {
> - of_node_put(node);
> - return true;
> - }
> -
> - return false;
> + return node ? true : false;
This better expressed as
return node != NULL;
I made the adjustment and applied, thank you.
--
Dmitry
Powered by blists - more mailing lists