* disconnect streams
* called from usb_audio_disconnect()
*/
-static void snd_usb_stream_disconnect(struct list_head *head)
+static void snd_usb_stream_disconnect(struct snd_usb_stream *as)
{
int idx;
- struct snd_usb_stream *as;
struct snd_usb_substream *subs;
- as = list_entry(head, struct snd_usb_stream, list);
for (idx = 0; idx < 2; idx++) {
subs = &as->substream[idx];
if (!subs->num_formats)
static int snd_usb_audio_free(struct snd_usb_audio *chip)
{
- struct list_head *p, *n;
+ struct snd_usb_endpoint *ep, *n;
- list_for_each_safe(p, n, &chip->ep_list)
- snd_usb_endpoint_free(p);
+ list_for_each_entry_safe(ep, n, &chip->ep_list, list)
+ snd_usb_endpoint_free(ep);
mutex_destroy(&chip->mutex);
kfree(chip);
mutex_lock(®ister_mutex);
chip->num_interfaces--;
if (chip->num_interfaces <= 0) {
+ struct snd_usb_stream *as;
struct snd_usb_endpoint *ep;
+ struct usb_mixer_interface *mixer;
snd_card_disconnect(card);
/* release the pcm resources */
- list_for_each(p, &chip->pcm_list) {
- snd_usb_stream_disconnect(p);
+ list_for_each_entry(as, &chip->pcm_list, list) {
+ snd_usb_stream_disconnect(as);
}
/* release the endpoint resources */
list_for_each_entry(ep, &chip->ep_list, list) {
snd_usbmidi_disconnect(p);
}
/* release mixer resources */
- list_for_each(p, &chip->mixer_list) {
- snd_usb_mixer_disconnect(p);
+ list_for_each_entry(mixer, &chip->mixer_list, list) {
+ snd_usb_mixer_disconnect(mixer);
}
usb_chip[chip->index] = NULL;
mutex_unlock(®ister_mutex);
/**
* snd_usb_endpoint_free: Free the resources of an snd_usb_endpoint
*
- * @ep: the list header of the endpoint to free
+ * @ep: the endpoint to free
*
* This free all resources of the given ep.
*/
-void snd_usb_endpoint_free(struct list_head *head)
+void snd_usb_endpoint_free(struct snd_usb_endpoint *ep)
{
- struct snd_usb_endpoint *ep;
-
- ep = list_entry(head, struct snd_usb_endpoint, list);
kfree(ep);
}