summaryrefslogtreecommitdiff
path: root/sound/usb/line6/toneport.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-25 20:36:29 +0300
committerTakashi Iwai <tiwai@suse.de>2015-01-28 09:22:07 +0300
commitaca514b82356dcc3575da33453382bd27593aea1 (patch)
treeccb08ee0c6142b905382df6d192375e5f53d257c /sound/usb/line6/toneport.c
parentf66fd990c5db177d6b9f0eae301ca6b15882eb2e (diff)
downloadlinux-aca514b82356dcc3575da33453382bd27593aea1.tar.xz
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>
Diffstat (limited to 'sound/usb/line6/toneport.c')
-rw-r--r--sound/usb/line6/toneport.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c
index 8e7020df0d10..33d16ecf18a0 100644
--- a/sound/usb/line6/toneport.c
+++ b/sound/usb/line6/toneport.c
@@ -558,14 +558,9 @@ static const struct line6_properties toneport_properties_table[] = {
static int toneport_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
- struct usb_line6_toneport *toneport;
-
- toneport = kzalloc(sizeof(*toneport), GFP_KERNEL);
- if (!toneport)
- return -ENODEV;
- return line6_probe(interface, id, &toneport->line6,
+ return line6_probe(interface, id,
&toneport_properties_table[id->driver_info],
- toneport_init);
+ toneport_init, sizeof(struct usb_line6_toneport));
}
static struct usb_driver toneport_driver = {