All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
@ 2013-07-23  9:12 Lars-Peter Clausen
  2013-07-23 12:49 ` Liam Girdwood
  2013-07-23 12:56 ` Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-07-23  9:12 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Lars-Peter Clausen

These two functions were added two years ago in commit 4805608 ("ASoC: dapm -
Add methods to retrieve snd_card and soc_card from dapm context.") but have
remained unused so far. Considering that the dapm context actually has a direct
pointer to the card the functions also seem to be unnecessary. E.g. the
expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-dapm.c | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 346ac91..deb1b3d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -174,36 +174,6 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
 	return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL);
 }
 
-/* get snd_card from DAPM context */
-static inline struct snd_card *dapm_get_snd_card(
-	struct snd_soc_dapm_context *dapm)
-{
-	if (dapm->codec)
-		return dapm->codec->card->snd_card;
-	else if (dapm->platform)
-		return dapm->platform->card->snd_card;
-	else
-		BUG();
-
-	/* unreachable */
-	return NULL;
-}
-
-/* get soc_card from DAPM context */
-static inline struct snd_soc_card *dapm_get_soc_card(
-		struct snd_soc_dapm_context *dapm)
-{
-	if (dapm->codec)
-		return dapm->codec->card;
-	else if (dapm->platform)
-		return dapm->platform->card;
-	else
-		BUG();
-
-	/* unreachable */
-	return NULL;
-}
-
 static void dapm_reset(struct snd_soc_card *card)
 {
 	struct snd_soc_dapm_widget *w;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23  9:12 [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card() Lars-Peter Clausen
@ 2013-07-23 12:49 ` Liam Girdwood
  2013-07-23 17:36   ` Mark Brown
  2013-07-23 19:14   ` Peter Ujfalusi
  2013-07-23 12:56 ` Mark Brown
  1 sibling, 2 replies; 9+ messages in thread
From: Liam Girdwood @ 2013-07-23 12:49 UTC (permalink / raw)
  To: Lars-Peter Clausen, Peter Ujfalusi; +Cc: alsa-devel, Mark Brown, Liam Girdwood

On Tue, 2013-07-23 at 11:12 +0200, Lars-Peter Clausen wrote:
> These two functions were added two years ago in commit 4805608 ("ASoC: dapm -
> Add methods to retrieve snd_card and soc_card from dapm context.") but have
> remained unused so far. Considering that the dapm context actually has a direct
> pointer to the card the functions also seem to be unnecessary. E.g. the
> expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---

Peter may have a user for these, but maybe not ?

Liam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23  9:12 [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card() Lars-Peter Clausen
  2013-07-23 12:49 ` Liam Girdwood
@ 2013-07-23 12:56 ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2013-07-23 12:56 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 480 bytes --]

On Tue, Jul 23, 2013 at 11:12:25AM +0200, Lars-Peter Clausen wrote:
> These two functions were added two years ago in commit 4805608 ("ASoC: dapm -
> Add methods to retrieve snd_card and soc_card from dapm context.") but have
> remained unused so far. Considering that the dapm context actually has a direct
> pointer to the card the functions also seem to be unnecessary. E.g. the
> expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23 12:49 ` Liam Girdwood
@ 2013-07-23 17:36   ` Mark Brown
  2013-07-23 17:57     ` Lars-Peter Clausen
  2013-07-23 19:14   ` Peter Ujfalusi
  1 sibling, 1 reply; 9+ messages in thread
From: Mark Brown @ 2013-07-23 17:36 UTC (permalink / raw)
  To: Liam Girdwood
  Cc: Peter Ujfalusi, alsa-devel, Lars-Peter Clausen, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 559 bytes --]

On Tue, Jul 23, 2013 at 01:49:42PM +0100, Liam Girdwood wrote:
> On Tue, 2013-07-23 at 11:12 +0200, Lars-Peter Clausen wrote:

> > Add methods to retrieve snd_card and soc_card from dapm context.") but have
> > remained unused so far. Considering that the dapm context actually has a direct
> > pointer to the card the functions also seem to be unnecessary. E.g. the
> > expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.

> Peter may have a user for these, but maybe not ?

We can always add them back in later if they get a user.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23 17:36   ` Mark Brown
@ 2013-07-23 17:57     ` Lars-Peter Clausen
  2013-07-23 19:32       ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-07-23 17:57 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Peter Ujfalusi, alsa-devel, Liam Girdwood

On 07/23/2013 07:36 PM, Mark Brown wrote:
> On Tue, Jul 23, 2013 at 01:49:42PM +0100, Liam Girdwood wrote:
>> On Tue, 2013-07-23 at 11:12 +0200, Lars-Peter Clausen wrote:
>
>>> Add methods to retrieve snd_card and soc_card from dapm context.") but have
>>> remained unused so far. Considering that the dapm context actually has a direct
>>> pointer to the card the functions also seem to be unnecessary. E.g. the
>>> expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.
>
>> Peter may have a user for these, but maybe not ?
>
> We can always add them back in later if they get a user.
>

If there are any out of tree users they should just use dapm->card instead. 
It's much more simpler than this 'if (dapm->codec) return dapm->codec->card; 
else if (dapm->platform) return dapm->platform->card;' and at the same time 
more robust since it also works for dapm contexts which don't belong to a codec 
or platform.

- Lars

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23 12:49 ` Liam Girdwood
  2013-07-23 17:36   ` Mark Brown
@ 2013-07-23 19:14   ` Peter Ujfalusi
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Ujfalusi @ 2013-07-23 19:14 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Mark Brown, Lars-Peter Clausen, Liam Girdwood, alsa-devel

On 07/23/2013 02:49 PM, Liam Girdwood wrote:
> On Tue, 2013-07-23 at 11:12 +0200, Lars-Peter Clausen wrote:
>> These two functions were added two years ago in commit 4805608 ("ASoC: dapm -
>> Add methods to retrieve snd_card and soc_card from dapm context.") but have
>> remained unused so far. Considering that the dapm context actually has a direct
>> pointer to the card the functions also seem to be unnecessary. E.g. the
>> expressions 'dapm_get_soc_card(dapm)' and 'dapm->card' yield the same result.
>>
>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>> ---
> 
> Peter may have a user for these, but maybe not ?

No, I do not use these.

-- 
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23 17:57     ` Lars-Peter Clausen
@ 2013-07-23 19:32       ` Mark Brown
  2013-07-23 19:47         ` Lars-Peter Clausen
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2013-07-23 19:32 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Liam Girdwood, Peter Ujfalusi, alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 646 bytes --]

On Tue, Jul 23, 2013 at 07:57:15PM +0200, Lars-Peter Clausen wrote:
> On 07/23/2013 07:36 PM, Mark Brown wrote:

> >We can always add them back in later if they get a user.

> If there are any out of tree users they should just use dapm->card
> instead. It's much more simpler than this 'if (dapm->codec) return
> dapm->codec->card; else if (dapm->platform) return
> dapm->platform->card;' and at the same time more robust since it
> also works for dapm contexts which don't belong to a codec or
> platform.

Right, though my thought looking at the code was that the intention was
to also do a transition so that dapm->card isn't there any more.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23 19:32       ` Mark Brown
@ 2013-07-23 19:47         ` Lars-Peter Clausen
  2013-07-24  0:10           ` Mark Brown
  0 siblings, 1 reply; 9+ messages in thread
From: Lars-Peter Clausen @ 2013-07-23 19:47 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, Peter Ujfalusi, alsa-devel, Liam Girdwood

On 07/23/2013 09:32 PM, Mark Brown wrote:
> On Tue, Jul 23, 2013 at 07:57:15PM +0200, Lars-Peter Clausen wrote:
>> On 07/23/2013 07:36 PM, Mark Brown wrote:
>
>>> We can always add them back in later if they get a user.
>
>> If there are any out of tree users they should just use dapm->card
>> instead. It's much more simpler than this 'if (dapm->codec) return
>> dapm->codec->card; else if (dapm->platform) return
>> dapm->platform->card;' and at the same time more robust since it
>> also works for dapm contexts which don't belong to a codec or
>> platform.
>
> Right, though my thought looking at the code was that the intention was
> to also do a transition so that dapm->card isn't there any more.

In a sense the dapm context is like a common base class to both platforms and 
codecs. So it's probably better to remove 'card' from the codec and platform 
structs. codec->dapm.card is as expensive as codec->card while looking up the 
card for the dapm context by either going through the platform or codec is more 
expensive than using the direct pointer. But hopefully the component stuff will 
fix that all.

- Lars

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card()
  2013-07-23 19:47         ` Lars-Peter Clausen
@ 2013-07-24  0:10           ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2013-07-24  0:10 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Liam Girdwood, Peter Ujfalusi, alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 536 bytes --]

On Tue, Jul 23, 2013 at 09:47:58PM +0200, Lars-Peter Clausen wrote:
> On 07/23/2013 09:32 PM, Mark Brown wrote:

> >Right, though my thought looking at the code was that the intention was
> >to also do a transition so that dapm->card isn't there any more.

> In a sense the dapm context is like a common base class to both
> platforms and codecs. So it's probably better to remove 'card' from

Yeah, I don't immediately see a way to go with the cleanup - that was
just my reading of why you might want to push things in that direction.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-24  0:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-23  9:12 [PATCH] ASoC: Remove unused dapm_get_snd_card() and dapm_get_soc_card() Lars-Peter Clausen
2013-07-23 12:49 ` Liam Girdwood
2013-07-23 17:36   ` Mark Brown
2013-07-23 17:57     ` Lars-Peter Clausen
2013-07-23 19:32       ` Mark Brown
2013-07-23 19:47         ` Lars-Peter Clausen
2013-07-24  0:10           ` Mark Brown
2013-07-23 19:14   ` Peter Ujfalusi
2013-07-23 12:56 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.