ALSA: usb-audio: Pass direct struct pointer instead of list_head
Some functions in mixer.c and endpoint.c receive list_head instead of the object itself. This is not obvious and rather error-prone. Let's pass the proper object directly instead. The functions in midi.c still receive list_head and this can't be changed since the object definition isn't exposed to the outside of midi.c, so left as is. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -1002,15 +1002,12 @@ void snd_usb_endpoint_release(struct snd_usb_endpoint *ep)
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user