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 /sound/core/pcm.c | |
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 'sound/core/pcm.c')
-rw-r--r-- | sound/core/pcm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index fbbbcd20c4cc..5ac6e19ccb41 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -910,7 +910,8 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream) | |||
910 | substream->pstr->substream_opened--; | 910 | substream->pstr->substream_opened--; |
911 | } | 911 | } |
912 | 912 | ||
913 | static ssize_t show_pcm_class(struct class_device *class_device, char *buf) | 913 | static ssize_t show_pcm_class(struct device *dev, |
914 | struct device_attribute *attr, char *buf) | ||
914 | { | 915 | { |
915 | struct snd_pcm *pcm; | 916 | struct snd_pcm *pcm; |
916 | const char *str; | 917 | const char *str; |
@@ -921,7 +922,7 @@ static ssize_t show_pcm_class(struct class_device *class_device, char *buf) | |||
921 | [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", | 922 | [SNDRV_PCM_CLASS_DIGITIZER] = "digitizer", |
922 | }; | 923 | }; |
923 | 924 | ||
924 | if (! (pcm = class_get_devdata(class_device)) || | 925 | if (! (pcm = dev_get_drvdata(dev)) || |
925 | pcm->dev_class > SNDRV_PCM_CLASS_LAST) | 926 | pcm->dev_class > SNDRV_PCM_CLASS_LAST) |
926 | str = "none"; | 927 | str = "none"; |
927 | else | 928 | else |
@@ -929,7 +930,7 @@ static ssize_t show_pcm_class(struct class_device *class_device, char *buf) | |||
929 | return snprintf(buf, PAGE_SIZE, "%s\n", str); | 930 | return snprintf(buf, PAGE_SIZE, "%s\n", str); |
930 | } | 931 | } |
931 | 932 | ||
932 | static struct class_device_attribute pcm_attrs = | 933 | static struct device_attribute pcm_attrs = |
933 | __ATTR(pcm_class, S_IRUGO, show_pcm_class, NULL); | 934 | __ATTR(pcm_class, S_IRUGO, show_pcm_class, NULL); |
934 | 935 | ||
935 | static int snd_pcm_dev_register(struct snd_device *device) | 936 | static int snd_pcm_dev_register(struct snd_device *device) |