diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-30 12:27:43 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-02-06 09:56:33 +0100 |
commit | 6bbc7fed849597ec35ffdcaf677910dd11d71d08 (patch) | |
tree | 570560b9981f146249c09fbcd8bde9cca8f3fc64 /include/sound/core.h | |
parent | 4227de2a7e5f0ff6a58e919a9c4f2bb06e882f48 (diff) | |
download | linux-6bbc7fed849597ec35ffdcaf677910dd11d71d08.tar.gz linux-6bbc7fed849597ec35ffdcaf677910dd11d71d08.tar.bz2 linux-6bbc7fed849597ec35ffdcaf677910dd11d71d08.zip |
ALSA: Add a helper to add a new attribute group to card
For assigning sysfs entries for a card device from the driver,
introduce a new helper function, snd_card_add_dev_attr(). In this
way, we can avoid the possible race between the device registration
and the sysfs addition / removal.
The driver can pass a new attribute group to add freely. This has to
be called before snd_card_register().
Currently, up to two extra groups can be added. More than that, it'll
return an error.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r-- | include/sound/core.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sound/core.h b/include/sound/core.h index 58882bfacdd7..da5748289968 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -132,6 +132,7 @@ struct snd_card { struct completion *release_completion; struct device *dev; /* device assigned to this card */ struct device card_dev; /* cardX object for sysfs */ + const struct attribute_group *dev_groups[4]; /* assigned sysfs attr */ bool registered; /* card_dev is registered? */ #ifdef CONFIG_PM @@ -262,6 +263,8 @@ void snd_card_set_id(struct snd_card *card, const char *id); int snd_card_register(struct snd_card *card); int snd_card_info_init(void); int snd_card_info_done(void); +int snd_card_add_dev_attr(struct snd_card *card, + const struct attribute_group *group); int snd_component_add(struct snd_card *card, const char *component); int snd_card_file_add(struct snd_card *card, struct file *file); int snd_card_file_remove(struct snd_card *card, struct file *file); |