Commit 81112c6f authored by R Sundar's avatar R Sundar Committed by Philipp Zabel

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: default avatarJulia Lawall <julia.lawall@inria.fr>
Signed-off-by: default avatarR Sundar <prosunofficial@gmail.com>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20240427045024.7083-1-prosunofficial@gmail.comSigned-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240427045024.7083-1-prosunofficial@gmail.com
parent 328ab568
...@@ -113,8 +113,8 @@ int ipu_pre_get_available_count(void) ...@@ -113,8 +113,8 @@ int ipu_pre_get_available_count(void)
struct ipu_pre * struct ipu_pre *
ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index) ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
{ {
struct device_node *pre_node = of_parse_phandle(dev->of_node, struct device_node *pre_node __free(device_node) =
name, index); of_parse_phandle(dev->of_node, name, index);
struct ipu_pre *pre; struct ipu_pre *pre;
mutex_lock(&ipu_pre_list_mutex); mutex_lock(&ipu_pre_list_mutex);
...@@ -123,14 +123,11 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index) ...@@ -123,14 +123,11 @@ ipu_pre_lookup_by_phandle(struct device *dev, const char *name, int index)
mutex_unlock(&ipu_pre_list_mutex); mutex_unlock(&ipu_pre_list_mutex);
device_link_add(dev, pre->dev, device_link_add(dev, pre->dev,
DL_FLAG_AUTOREMOVE_CONSUMER); DL_FLAG_AUTOREMOVE_CONSUMER);
of_node_put(pre_node);
return pre; return pre;
} }
} }
mutex_unlock(&ipu_pre_list_mutex); mutex_unlock(&ipu_pre_list_mutex);
of_node_put(pre_node);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment