[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxSE59Qc_Zp_Azb3@google.com>
Date: Sat, 19 Oct 2024 21:19:51 -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 08/10] Input: i8042 - use cleanup facility for device_node
On Thu, Oct 10, 2024 at 11:25:58PM +0200, Javier Carrasco wrote:
> Use the '__free(device_node)' macro to automatically free the device
> node, removing the need for explicit calls to 'of_node_put()' to
> decrement its refcount.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@...il.com>
> ---
> drivers/input/serio/i8042-sparcio.h | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
> index c2fda54dc384..8f38b6f4ae77 100644
> --- a/drivers/input/serio/i8042-sparcio.h
> +++ b/drivers/input/serio/i8042-sparcio.h
> @@ -106,17 +106,13 @@ static struct platform_driver sparc_i8042_driver = {
>
> static bool i8042_is_mr_coffee(void)
> {
> - struct device_node *root;
> + struct device_node *root __free(device_node) = of_find_node_by_path("/");
> const char *name;
> bool is_mr_coffee;
This temporary is no longer needed. I removed it and applied, thanks.
>
> - root = of_find_node_by_path("/");
> -
> name = of_get_property(root, "name", NULL);
> is_mr_coffee = name && !strcmp(name, "SUNW,JavaStation-1");
>
> - of_node_put(root);
> -
> return is_mr_coffee;
> }
>
>
> --
> 2.43.0
>
--
Dmitry
Powered by blists - more mailing lists