diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-08 01:19:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:52:01 -0500 |
commit | d80f19fab89cba8a6d16193154c8ff3edab00942 (patch) | |
tree | 5d6b567a45ca4cc014bf5a1d10622c91ece2f63e /include/sound/core.h | |
parent | ebf644c4623bc3eb57683199cd2b9080028b0f6f (diff) |
Driver core: convert sound core to use struct device
Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.
It also makes the struct sound_card to show up as a "real" device
where all the different sound class devices are placed as childs
and different card attribute files can hang off of. /sys/class/sound is
still a flat directory, but the symlink targets of all devices belonging
to the same card, point the the /sys/devices tree below the new card
device object.
Thanks to Kay for the updates to this patch.
Signed-off-by: Kay Sievers <kay.sievers@novell.com>
Acked-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r-- | include/sound/core.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/sound/core.h b/include/sound/core.h index fa1ca0127bab..a994bea09cd6 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -132,6 +132,7 @@ struct snd_card { | |||
132 | int shutdown; /* this card is going down */ | 132 | int shutdown; /* this card is going down */ |
133 | int free_on_last_close; /* free in context of file_release */ | 133 | int free_on_last_close; /* free in context of file_release */ |
134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
135 | struct device *parent; | ||
135 | struct device *dev; | 136 | struct device *dev; |
136 | 137 | ||
137 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
@@ -187,13 +188,14 @@ struct snd_minor { | |||
187 | int device; /* device number */ | 188 | int device; /* device number */ |
188 | const struct file_operations *f_ops; /* file operations */ | 189 | const struct file_operations *f_ops; /* file operations */ |
189 | void *private_data; /* private data for f_ops->open */ | 190 | void *private_data; /* private data for f_ops->open */ |
190 | struct class_device *class_dev; /* class device for sysfs */ | 191 | struct device *dev; /* device for sysfs */ |
191 | }; | 192 | }; |
192 | 193 | ||
193 | /* sound.c */ | 194 | /* sound.c */ |
194 | 195 | ||
195 | extern int snd_major; | 196 | extern int snd_major; |
196 | extern int snd_ecards_limit; | 197 | extern int snd_ecards_limit; |
198 | extern struct class *sound_class; | ||
197 | 199 | ||
198 | void snd_request_card(int card); | 200 | void snd_request_card(int card); |
199 | 201 | ||
@@ -203,7 +205,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, | |||
203 | int snd_unregister_device(int type, struct snd_card *card, int dev); | 205 | int snd_unregister_device(int type, struct snd_card *card, int dev); |
204 | void *snd_lookup_minor_data(unsigned int minor, int type); | 206 | void *snd_lookup_minor_data(unsigned int minor, int type); |
205 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, | 207 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, |
206 | const struct class_device_attribute *attr); | 208 | struct device_attribute *attr); |
207 | 209 | ||
208 | #ifdef CONFIG_SND_OSSEMUL | 210 | #ifdef CONFIG_SND_OSSEMUL |
209 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 211 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
@@ -255,7 +257,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file); | |||
255 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 257 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
256 | 258 | ||
257 | #ifndef snd_card_set_dev | 259 | #ifndef snd_card_set_dev |
258 | #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) | 260 | #define snd_card_set_dev(card,devptr) ((card)->parent = (devptr)) |
259 | #endif | 261 | #endif |
260 | 262 | ||
261 | /* device.c */ | 263 | /* device.c */ |