aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2024-07-03 14:11:00 +0200
committerMark Brown <[email protected]>2024-07-08 12:49:59 +0100
commit5725c16af2678d334de0bcb85b42cfa50b32e04c (patch)
tree0522818f10fa507774b7d6eb53340c3ba8865af7
parent6440e7b2a058c50a05ebcc58f35693c50522fc1a (diff)
ASoC: audio-graph-card: Use cleanup.h instead of devm_kfree()
Allocate the memory with scoped/cleanup.h, instead of devm interface, to make the code more obvious that memory is not used outside this scope. Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/generic/audio-graph-card.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index acf7d92d21e6..3425fbbcbd7e 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -7,6 +7,7 @@
//
// based on ${LINUX}/sound/soc/generic/simple-card.c
+#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
@@ -573,10 +574,9 @@ static int graph_get_dais_count(struct simple_util_priv *priv,
int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev)
{
struct snd_soc_card *card = simple_priv_to_card(priv);
- struct link_info *li;
int ret;
- li = devm_kzalloc(dev, sizeof(*li), GFP_KERNEL);
+ struct link_info *li __free(kfree) = kzalloc(sizeof(*li), GFP_KERNEL);
if (!li)
return -ENOMEM;
@@ -628,7 +628,6 @@ int audio_graph_parse_of(struct simple_util_priv *priv, struct device *dev)
if (ret < 0)
goto err;
- devm_kfree(dev, li);
return 0;
err: