ALSA: Create sysfs attribute files via groups

Instead of calling each time device_create_file(), create the groups
of sysfs attribute files at once in a normal way.  Add a new helper
function, snd_get_device(), to return the associated device object,
so that we can handle the sysfs addition locally.

Since the sysfs file addition is done differently now,
snd_add_device_sysfs_file() helper function is removed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai
2014-02-25 08:30:50 +01:00
parent d01a838c86
commit caa751bad4
8 changed files with 112 additions and 103 deletions

View File

@@ -68,6 +68,7 @@ struct snd_hwdep {
wait_queue_head_t open_wait;
void *private_data;
void (*private_free) (struct snd_hwdep *hwdep);
const struct attribute_group **groups;
struct mutex open_mutex;
int used; /* reference counter */