diff mbox series

[1/2] ASoC: audio-graph: Export graph_remove() function

Message ID 1612368575-25991-2-git-send-email-spujar@nvidia.com
State New
Headers show
Series [1/2] ASoC: audio-graph: Export graph_remove() function | expand

Commit Message

Sameer Pujar Feb. 3, 2021, 4:09 p.m. UTC
Audio graph based sound card drivers can call graph_remove() function
for cleanups during driver removal. To facilitate this export above
mentioned function.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/graph_card.h           | 2 ++
 sound/soc/generic/audio-graph-card.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Mark Brown Feb. 3, 2021, 4:19 p.m. UTC | #1
On Wed, Feb 03, 2021 at 09:39:34PM +0530, Sameer Pujar wrote:

> +int graph_remove(struct platform_device *pdev);

I think this needs better namespacing if it's going to be exported.
Sameer Pujar Feb. 3, 2021, 4:39 p.m. UTC | #2
On 2/3/2021 9:49 PM, Mark Brown wrote:
> On Wed, Feb 03, 2021 at 09:39:34PM +0530, Sameer Pujar wrote:
>
>> +int graph_remove(struct platform_device *pdev);
> I think this needs better namespacing if it's going to be exported.

audio_graph_remove() can be a better choice?
Mark Brown Feb. 3, 2021, 5:24 p.m. UTC | #3
On Wed, Feb 03, 2021 at 10:09:01PM +0530, Sameer Pujar wrote:
> On 2/3/2021 9:49 PM, Mark Brown wrote:
> > On Wed, Feb 03, 2021 at 09:39:34PM +0530, Sameer Pujar wrote:

> > > +int graph_remove(struct platform_device *pdev);

> > I think this needs better namespacing if it's going to be exported.

> audio_graph_remove() can be a better choice?

Yeah, that looks reasonable.
Kuninori Morimoto Feb. 3, 2021, 10:33 p.m. UTC | #4
Hi

> > > > +int graph_remove(struct platform_device *pdev);
> 
> > > I think this needs better namespacing if it's going to be exported.
> 
> > audio_graph_remove() can be a better choice?
> 
> Yeah, that looks reasonable.

Nice naming I think.
In such case,  update also graph_parse_of() is nice idea for me.

	- int graph_parse_of(...)
	+ int audio_graph_parse_of()

Thank you for your help !!

Best regards
---
Kuninori Morimoto
Sameer Pujar Feb. 4, 2021, 3:39 a.m. UTC | #5
On 2/4/2021 4:01 AM, Kuninori Morimoto wrote:
>> Audio graph based sound card drivers can call graph_remove() function
>> for cleanups during driver removal. To facilitate this export above
>> mentioned function.
>>
>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
>> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> (snip)
>> -static int graph_remove(struct platform_device *pdev)
>> +int graph_remove(struct platform_device *pdev)
>>   {
>>        struct snd_soc_card *card = platform_get_drvdata(pdev);
>>
>>        return asoc_simple_clean_reference(card);
>>   }
>> +EXPORT_SYMBOL_GPL(graph_remove);
> Not a big deal, but
> it is just calling asoc_simple_clean_reference() which is
> already global function.

Yes that is true, but idea was to put dependency on graph_remove() so 
that any additions/changes here in future will be automatically taken 
care for Tegra graph card.
Sameer Pujar Feb. 4, 2021, 3:45 a.m. UTC | #6
On 2/4/2021 4:03 AM, Kuninori Morimoto wrote:
> External email: Use caution opening links or attachments
>
>
> Hi
>
>>>>> +int graph_remove(struct platform_device *pdev);
>>>> I think this needs better namespacing if it's going to be exported.
>>> audio_graph_remove() can be a better choice?
>> Yeah, that looks reasonable.
> Nice naming I think.
> In such case,  update also graph_parse_of() is nice idea for me.
>
>          - int graph_parse_of(...)
>          + int audio_graph_parse_of()

OK, Will update following.

graph_remove()     --> audio_graph_remove()
graph_parse_of()   --> audio_graph_parse_of()
graph_card_probe() --> audio_graph_card_probe()
diff mbox series

Patch

diff --git a/include/sound/graph_card.h b/include/sound/graph_card.h
index bbb5a13..dfa8e56 100644
--- a/include/sound/graph_card.h
+++ b/include/sound/graph_card.h
@@ -13,4 +13,6 @@  int graph_card_probe(struct snd_soc_card *card);
 
 int graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
 
+int graph_remove(struct platform_device *pdev);
+
 #endif /* __GRAPH_CARD_H */
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 16a04a6..93f6d57f 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -744,12 +744,13 @@  static int graph_probe(struct platform_device *pdev)
 	return graph_parse_of(priv, dev);
 }
 
-static int graph_remove(struct platform_device *pdev)
+int graph_remove(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = platform_get_drvdata(pdev);
 
 	return asoc_simple_clean_reference(card);
 }
+EXPORT_SYMBOL_GPL(graph_remove);
 
 static const struct of_device_id graph_of_match[] = {
 	{ .compatible = "audio-graph-card", },