diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-25 20:22:58 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-28 09:21:59 +0300 |
commit | f66fd990c5db177d6b9f0eae301ca6b15882eb2e (patch) | |
tree | e583afc51d0962a9f803adfe40e77ff6adefc690 /sound/usb/line6/toneport.c | |
parent | 62a109d9e2ce948ee75222bbb92a97669f683875 (diff) | |
download | linux-f66fd990c5db177d6b9f0eae301ca6b15882eb2e.tar.xz |
ALSA: line6: Drop interface argument from private_init and disconnect callbacks
The interface argument is used just for retrieving the assigned
device, which can be already found in line6->ifcdev. Drop them from
the callbacks. Also, pass the usb id to private_init so that the
driver can deal with it there. This is a preliminary work for the
further cleanup to move the whole allocation into driver.c.
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.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c index 9a769463f7bf..8e7020df0d10 100644 --- a/sound/usb/line6/toneport.c +++ b/sound/usb/line6/toneport.c @@ -387,11 +387,11 @@ static void toneport_setup(struct usb_line6_toneport *toneport) /* Toneport device disconnected. */ -static void line6_toneport_disconnect(struct usb_interface *interface) +static void line6_toneport_disconnect(struct usb_line6 *line6) { - struct usb_line6_toneport *toneport; + struct usb_line6_toneport *toneport = + (struct usb_line6_toneport *)line6; - toneport = usb_get_intfdata(interface); del_timer_sync(&toneport->timer); if (toneport_has_led(toneport->type)) @@ -402,12 +402,13 @@ static void line6_toneport_disconnect(struct usb_interface *interface) /* Try to init Toneport device. */ -static int toneport_init(struct usb_interface *interface, - struct usb_line6 *line6) +static int toneport_init(struct usb_line6 *line6, + const struct usb_device_id *id) { int err; struct usb_line6_toneport *toneport = (struct usb_line6_toneport *) line6; + toneport->type = id->driver_info; setup_timer(&toneport->timer, toneport_start_pcm, (unsigned long)toneport); @@ -562,8 +563,7 @@ static int toneport_probe(struct usb_interface *interface, toneport = kzalloc(sizeof(*toneport), GFP_KERNEL); if (!toneport) return -ENODEV; - toneport->type = id->driver_info; - return line6_probe(interface, &toneport->line6, + return line6_probe(interface, id, &toneport->line6, &toneport_properties_table[id->driver_info], toneport_init); } |