ALSA: line6: Let snd_card_new() allocate private data
Instead of allocating the private data individually in each driver's
probe at first, let snd_card_new() allocate the data that is called in
line6_probe(). This simplifies the primary probe functions.
Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c
index d1e952f..6f7cd58 100644
--- a/sound/usb/line6/pod.c
+++ b/sound/usb/line6/pod.c
@@ -591,14 +591,9 @@
static int pod_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
- struct usb_line6_pod *pod;
-
- pod = kzalloc(sizeof(*pod), GFP_KERNEL);
- if (!pod)
- return -ENODEV;
- return line6_probe(interface, id, &pod->line6,
+ return line6_probe(interface, id,
&pod_properties_table[id->driver_info],
- pod_init);
+ pod_init, sizeof(struct usb_line6_pod));
}
static struct usb_driver pod_driver = {