[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240419111613.GA12884@aspen.lan>
Date: Fri, 19 Apr 2024 12:16:13 +0100
From: Daniel Thompson <daniel.thompson@...aro.org>
To: Shresth Prasad <shresthprasad7@...il.com>
Cc: lee@...nel.org, jingoohan1@...il.com, deller@....de,
dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
linux-kernel@...r.kernel.org, skhan@...uxfoundation.org,
javier.carrasco.cruz@...il.com,
Julia Lawall <julia.lawall@...ia.fr>
Subject: Re: [PATCH][next] drivers: video: Simplify device_node cleanup using
__free
^^^
Please fix the subject line to be "backlight: <driver>: ...". I came
very close to deleting this patch without reading it ;-) .
On Fri, Apr 19, 2024 at 01:13:02AM +0530, Shresth Prasad wrote:
> diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c
> index eb18c6eb0ff0..3c5d8125080c 100644
> --- a/drivers/video/backlight/sky81452-backlight.c
> +++ b/drivers/video/backlight/sky81452-backlight.c
> @@ -182,7 +182,7 @@ static const struct attribute_group sky81452_bl_attr_group = {
> static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
> struct device *dev)
> {
> - struct device_node *np = of_node_get(dev->of_node);
> + struct device_node *np __free(device_node) = of_node_get(dev->of_node);
Do we need to get dev->of_node at all? The device, which we are
borrowing, already owns a reference to the node so I don't see
any point in this function taking an extra one.
So why not simply make this:
struct device_node *np = dev->of_node;
Daniel.
Powered by blists - more mailing lists