Re: [PATCH v2] ALSA: hda/tas2781: leave hda_component in usable state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 08 Dec 2023 19:06:49 +0100,
Gergo Koteles wrote:
> 
> @@ -612,9 +612,13 @@ static void tas2781_hda_unbind(struct device *dev,
>  {
>  	struct tasdevice_priv *tas_priv = dev_get_drvdata(dev);
>  	struct hda_component *comps = master_data;
> +	comps = &comps[tas_priv->index];
>  
> -	if (comps[tas_priv->index].dev == dev)
> -		memset(&comps[tas_priv->index], 0, sizeof(*comps));
> +	if (comps->dev == dev) {
> +		comps->dev = NULL;
> +		strscpy(comps->name, "", sizeof(comps->name));

This looks suboptimal.  Either just set *comp->name = 0, or fill all
with memset().


thanks,

Takashi



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux