summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR Sundar <prosunofficial@gmail.com>2024-04-27 10:20:24 +0530
committerPhilipp Zabel <p.zabel@pengutronix.de>2024-06-26 17:43:46 +0200
commit81112c6f36b513cdcf2506ffacdb92c7674737f2 (patch)
treebd1c521cdccf9cc4943368b4caad2d59435d9d44
parent328ab5688f9865d06aa74599f34f5bc51905f9b9 (diff)
downloadlwn-81112c6f36b513cdcf2506ffacdb92c7674737f2.tar.gz
lwn-81112c6f36b513cdcf2506ffacdb92c7674737f2.zip
gpu: ipu-v3: pre: replace of_node_put() with __free
use the new cleanup magic to replace of_node_put() with __free(device_node) marking to auto release when they get out of scope. Suggested-by: Julia Lawall <julia.lawall@inria.fr> Signed-off-by: R Sundar <prosunofficial@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20240427045024.7083-1-prosunofficial@gmail.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240427045024.7083-1-prosunofficial@gmail.com
-rw-r--r--drivers/gpu/ipu-v3/ipu-pre.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-pre.c b/drivers/gpu/ipu-v3/ipu-pre.c
index aef984a43190..08d0034f0604 100644
--- a/drivers/gpu/ipu-v3/ipu-pre.c
+++ b/drivers/gpu/ipu-v3/ipu-pre.c
@@ -113,8 +113,8 @@ int ipu_pre_get_available_count(void)
struct ipu_pre *
ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
{
- struct device_node *pre_node = of_parse_phandle(dev->of_node,
- name, index);
+ struct device_node *pre_node __free(device_node) =
+ of_parse_phandle(dev->of_node, name, index);
struct ipu_pre *pre;
mutex_lock(&ipu_pre_list_mutex);
@@ -123,14 +123,11 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
mutex_unlock(&ipu_pre_list_mutex);
device_link_add(dev, pre->dev,
DL_FLAG_AUTOREMOVE_CONSUMER);
- of_node_put(pre_node);
return pre;
}
}
mutex_unlock(&ipu_pre_list_mutex);
- of_node_put(pre_node);
-
return NULL;
}