Re: RFC: add possibility to change text identification string

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

 



At Wed, 12 Nov 2008 16:29:22 +0100 (CET),
Jaroslav Kysela wrote:
> 
> On Wed, 12 Nov 2008, Takashi Iwai wrote:
> 
> > At Tue, 11 Nov 2008 17:33:42 +0100,
> > I wrote:
> > > 
> > > At Tue, 11 Nov 2008 17:00:41 +0100 (CET),
> > > Jaroslav Kysela wrote:
> > > > 
> > > > Hi all,
> > > > 
> > > > 	based on discussion today, I prepared a patch to handle udev-style 
> > > > card renaming. Comments are welcome.
> > > 
> > > Looks good to me.  The sanity check of the id string should be used
> > > for the assignment from the module option, too.
> > 
> > One remaining problem I found is a symlink of id in /proc/asound.
> > This won't be changed even if you change the id string via sysfs.
> > A minor issue, though.
> 
> Thanks for this note. The patch bellow should fix this issue. Also, I'm 
> going to remove card->id from hdsp.c and hdspm.c where this string is 
> used for rawmidi device name - it might be confusing when changed, too.
> 
> 						Jaroslav
> 
> diff --git a/include/sound/info.h b/include/sound/info.h
> index 8ae72e7..baf09d8 100644
> --- a/include/sound/info.h
> +++ b/include/sound/info.h
> @@ -126,6 +126,7 @@ int snd_info_card_create(struct snd_card * card);
>  int snd_info_card_register(struct snd_card * card);
>  int snd_info_card_free(struct snd_card * card);
>  void snd_info_card_disconnect(struct snd_card * card);
> +void snd_info_card_id_change(struct snd_card * card);
>  int snd_info_register(struct snd_info_entry * entry);

Don't forget for the case CONFIG_PROC_FS=n.

>  
>  /* for card drivers */
> diff --git a/sound/core/info.c b/sound/core/info.c
> index 527b207..e91da07 100644
> --- a/sound/core/info.c
> +++ b/sound/core/info.c
> @@ -653,6 +653,21 @@ int snd_info_card_register(struct snd_card *card)
>  }
>  
>  /*
> + * called on card->id change
> + */
> +void snd_info_card_id_change(struct snd_card *card)
> +{
> +	mutex_lock(&info_mutex);
> +	if (card->proc_root_link) {
> +		snd_remove_proc_entry(snd_proc_root, card->proc_root_link);
> +		card->proc_root_link = NULL;
> +	}
> +	if (strcmp(card->id, card->proc_root->name))
> +		card->proc_root_link = proc_symlink(card->id, snd_proc_root, card->proc_root->name);

checkpatch.pl is your friend ;)


thanks,

Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

  Powered by Linux