diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-07 03:06:05 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-07 03:06:05 -0500 |
commit | 63cf123bf5d538a066e4a899390c9ce56ab6df9f (patch) | |
tree | 00a5e6eabcfdd310247018188f8ebe35b8b6f1ba /sound/core | |
parent | 6834d7ce224a6f6a1dd05da3a867730c40943154 (diff) | |
parent | fcef7836a31c6432b41a38867d413ed3d6aa8261 (diff) |
Merge branch 'topic/fix/misc' into topic/misc
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/control.c | 7 | ||||
-rw-r--r-- | sound/core/rawmidi.c | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sound/core/control.c b/sound/core/control.c index 6d71f9a7ccbb..b0bf42691047 100644 --- a/sound/core/control.c +++ b/sound/core/control.c | |||
@@ -225,8 +225,13 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol, | |||
225 | kctl.id.iface = ncontrol->iface; | 225 | kctl.id.iface = ncontrol->iface; |
226 | kctl.id.device = ncontrol->device; | 226 | kctl.id.device = ncontrol->device; |
227 | kctl.id.subdevice = ncontrol->subdevice; | 227 | kctl.id.subdevice = ncontrol->subdevice; |
228 | if (ncontrol->name) | 228 | if (ncontrol->name) { |
229 | strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); | 229 | strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); |
230 | if (strcmp(ncontrol->name, kctl.id.name) != 0) | ||
231 | snd_printk(KERN_WARNING | ||
232 | "Control name '%s' truncated to '%s'\n", | ||
233 | ncontrol->name, kctl.id.name); | ||
234 | } | ||
230 | kctl.id.index = ncontrol->index; | 235 | kctl.id.index = ncontrol->index; |
231 | kctl.count = ncontrol->count ? ncontrol->count : 1; | 236 | kctl.count = ncontrol->count ? ncontrol->count : 1; |
232 | access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : | 237 | access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : |
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index c4995c9f5730..39672f68ce5d 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -148,6 +148,8 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream) | |||
148 | 148 | ||
149 | static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) | 149 | static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) |
150 | { | 150 | { |
151 | if (!substream->opened) | ||
152 | return; | ||
151 | if (up) { | 153 | if (up) { |
152 | tasklet_hi_schedule(&substream->runtime->tasklet); | 154 | tasklet_hi_schedule(&substream->runtime->tasklet); |
153 | } else { | 155 | } else { |
@@ -158,6 +160,8 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs | |||
158 | 160 | ||
159 | static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) | 161 | static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) |
160 | { | 162 | { |
163 | if (!substream->opened) | ||
164 | return; | ||
161 | substream->ops->trigger(substream, up); | 165 | substream->ops->trigger(substream, up); |
162 | if (!up && substream->runtime->event) | 166 | if (!up && substream->runtime->event) |
163 | tasklet_kill(&substream->runtime->tasklet); | 167 | tasklet_kill(&substream->runtime->tasklet); |
@@ -857,6 +861,8 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, | |||
857 | int result = 0, count1; | 861 | int result = 0, count1; |
858 | struct snd_rawmidi_runtime *runtime = substream->runtime; | 862 | struct snd_rawmidi_runtime *runtime = substream->runtime; |
859 | 863 | ||
864 | if (!substream->opened) | ||
865 | return -EBADFD; | ||
860 | if (runtime->buffer == NULL) { | 866 | if (runtime->buffer == NULL) { |
861 | snd_printd("snd_rawmidi_receive: input is not active!!!\n"); | 867 | snd_printd("snd_rawmidi_receive: input is not active!!!\n"); |
862 | return -EINVAL; | 868 | return -EINVAL; |
@@ -1126,6 +1132,8 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) | |||
1126 | int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, | 1132 | int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, |
1127 | unsigned char *buffer, int count) | 1133 | unsigned char *buffer, int count) |
1128 | { | 1134 | { |
1135 | if (!substream->opened) | ||
1136 | return -EBADFD; | ||
1129 | count = snd_rawmidi_transmit_peek(substream, buffer, count); | 1137 | count = snd_rawmidi_transmit_peek(substream, buffer, count); |
1130 | if (count < 0) | 1138 | if (count < 0) |
1131 | return count; | 1139 | return count; |