diff mbox series

[v3,3/4] ASoC: cs35l45: Use new snd_soc_component_get_kcontrol() helper

Message ID 20240801100413.1620481-3-ckeepax@opensource.cirrus.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/4] ASoC: cs42l43: Remove redundant semi-colon at end of function | expand

Commit Message

Charles Keepax Aug. 1, 2024, 10:04 a.m. UTC
No longer any need to hard code the addition of the name prefix, use the
new helper.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---

No change since v2.

Thanks,
Charles

 sound/soc/codecs/cs35l45.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Mark Brown Aug. 1, 2024, 4:38 p.m. UTC | #1
On Thu, Aug 01, 2024 at 11:04:12AM +0100, Charles Keepax wrote:
> No longer any need to hard code the addition of the name prefix, use the
> new helper.

> -	kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name);
> +	kcontrol = snd_soc_component_get_kcontrol_locked(component->card, ctl_name);

That's not the helper that the subject line references, nor the one
added by the prior patch - did you test this?

Please use cover letters for patch serieses too.
Charles Keepax Aug. 2, 2024, 8:44 a.m. UTC | #2
On Thu, Aug 01, 2024 at 05:38:32PM +0100, Mark Brown wrote:
> On Thu, Aug 01, 2024 at 11:04:12AM +0100, Charles Keepax wrote:
> > No longer any need to hard code the addition of the name prefix, use the
> > new helper.
> 
> > -	kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name);
> > +	kcontrol = snd_soc_component_get_kcontrol_locked(component->card, ctl_name);
> 
> That's not the helper that the subject line references, nor the one
> added by the prior patch - did you test this?
> 
> Please use cover letters for patch serieses too.

Well I thought I did but clearly not, apologies will check it and
send a new spin.

Thanks,
Charles
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
index 2392c6effed85..1fefdb80d758c 100644
--- a/sound/soc/codecs/cs35l45.c
+++ b/sound/soc/codecs/cs35l45.c
@@ -176,17 +176,10 @@  static int cs35l45_activate_ctl(struct snd_soc_component *component,
 	struct snd_kcontrol *kcontrol;
 	struct snd_kcontrol_volatile *vd;
 	unsigned int index_offset;
-	char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
 
-	if (component->name_prefix)
-		snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s %s",
-			 component->name_prefix, ctl_name);
-	else
-		snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", ctl_name);
-
-	kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name);
+	kcontrol = snd_soc_component_get_kcontrol_locked(component->card, ctl_name);
 	if (!kcontrol) {
-		dev_err(component->dev, "Can't find kcontrol %s\n", name);
+		dev_err(component->dev, "Can't find kcontrol %s\n", ctl_name);
 		return -EINVAL;
 	}