[PATCH v4 09/10] ALSA: hda/realtek: Add support for Legion 7 16ACHg6 laptop

Takashi Iwai tiwai at suse.de
Tue Dec 14 17:34:20 CET 2021


On Tue, 14 Dec 2021 14:59:58 +0100,
Lucas Tanure wrote:
> 
> Add Support for CS35L41 using the component binding
> method
> 
> Signed-off-by: Lucas Tanure <tanureal at opensource.cirrus.com>

Through a quick glance, the patch looks almost fine, just a few
nitpicking:

> @@ -6497,6 +6502,105 @@ static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec,
>  	}
>  }
>  
> +static int comp_match_dev_name(struct device *dev, void *data)
> +{
> +	if (strcmp(dev_name(dev), data) == 0)
> +		return 1;
> +
> +	return 0;

This could be a oneliner:
	return strcmp(dev_name(dev), data) == 0;


> +void comp_generic_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *codec,
> +				struct snd_pcm_substream *sub, int action)

Missing static?

> +void alc287_legion_16achg6_playback_hook(struct hda_pcm_stream *hinfo, struct hda_codec *codec,
> +					 struct snd_pcm_substream *sub, int action)

Ditto.

> +{
> +	struct alc_spec *spec = codec->spec;
> +	unsigned int rx_slot;
> +	int i = 0;

A superfluous variable initialization.


thanks,

Takashi


More information about the Alsa-devel mailing list