From aca514b82356dcc3575da33453382bd27593aea1 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sun, 25 Jan 2015 18:36:29 +0100 Subject: 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 Signed-off-by: Takashi Iwai --- sound/usb/line6/variax.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'sound/usb/line6/variax.c') diff --git a/sound/usb/line6/variax.c b/sound/usb/line6/variax.c index ba6e85eed2ba..9701ffa61365 100644 --- a/sound/usb/line6/variax.c +++ b/sound/usb/line6/variax.c @@ -296,14 +296,9 @@ static const struct line6_properties variax_properties_table[] = { static int variax_probe(struct usb_interface *interface, const struct usb_device_id *id) { - struct usb_line6_variax *variax; - - variax = kzalloc(sizeof(*variax), GFP_KERNEL); - if (!variax) - return -ENODEV; - return line6_probe(interface, id, &variax->line6, + return line6_probe(interface, id, &variax_properties_table[id->driver_info], - variax_init); + variax_init, sizeof(struct usb_line6_variax)); } static struct usb_driver variax_driver = { -- cgit v1.2.3