diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-01-26 06:40:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-01-29 17:32:53 -0500 |
commit | 7d2aae1e88660cf09be913e9754e45189dc33412 (patch) | |
tree | af56ebcced14fb8e40640d9555129aab2ffa0532 /sound/core/sound_oss.c | |
parent | 5263bf65d6342e12ab716db8e529501670979321 (diff) |
[PATCH] ALSA: Fix sysfs breakage
The recent change for a new sysfs tree with card* object breaks the
/sys/class/sound tree if CONFIG_SYSFS_DEPRECATED is enabled.
The device in each entry doesn't point the correct device object:
/sys/class/sound
...
|-- pcmC0D0c
| |-- dev
| |-- device -> ../../../class/sound/card0
| |-- pcm_class
| |-- power
| | `-- wakeup
| |-- subsystem -> ../../../class/sound
| `-- uevent
Also, this change breaks some drivers (like sound/arm/*) referring
card->dev directly to obtain the device object for memory handling.
This patch reverts the semantics of card->dev to the former version,
which points to a real device object. The card* object is stored in a
new card->card_dev field, instead. The device parent is chosen either
card->dev or card->card_dev according to CONFIG_SYSFS_DEPRECATED to
keep the tree compatibility.
Also, card* isn't created if CONFIG_SYSFS_DEPRECATED is enabled. The
reason of card* object is a root of all beloing devices, and it makes
little sense if each sound device points to the real device object
directly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Monty Montgomery <xiphmont@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/core/sound_oss.c')
-rw-r--r-- | sound/core/sound_oss.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index b2fc40aa520..4566df41912 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c | |||
@@ -106,7 +106,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, | |||
106 | int cidx = SNDRV_MINOR_OSS_CARD(minor); | 106 | int cidx = SNDRV_MINOR_OSS_CARD(minor); |
107 | int track2 = -1; | 107 | int track2 = -1; |
108 | int register1 = -1, register2 = -1; | 108 | int register1 = -1, register2 = -1; |
109 | struct device *carddev = NULL; | 109 | struct device *carddev = snd_card_get_device_link(card); |
110 | 110 | ||
111 | if (card && card->number >= 8) | 111 | if (card && card->number >= 8) |
112 | return 0; /* ignore silently */ | 112 | return 0; /* ignore silently */ |
@@ -134,8 +134,6 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, | |||
134 | track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_DMMIDI1); | 134 | track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_DMMIDI1); |
135 | break; | 135 | break; |
136 | } | 136 | } |
137 | if (card) | ||
138 | carddev = card->dev; | ||
139 | register1 = register_sound_special_device(f_ops, minor, carddev); | 137 | register1 = register_sound_special_device(f_ops, minor, carddev); |
140 | if (register1 != minor) | 138 | if (register1 != minor) |
141 | goto __end; | 139 | goto __end; |