Probe USB device.
*/
int line6_probe(struct usb_interface *interface,
+ const struct usb_device_id *id,
struct usb_line6 *line6,
const struct line6_properties *properties,
- int (*private_init)(struct usb_interface *, struct usb_line6 *))
+ int (*private_init)(struct usb_line6 *, const struct usb_device_id *id))
{
struct usb_device *usbdev = interface_to_usbdev(interface);
struct snd_card *card;
}
/* initialize device data based on device: */
- ret = private_init(interface, line6);
+ ret = private_init(line6, id);
if (ret < 0)
goto error;
error:
if (line6->disconnect)
- line6->disconnect(interface);
+ line6->disconnect(line6);
snd_card_free(card);
return ret;
}
if (line6->line6pcm)
line6_pcm_disconnect(line6->line6pcm);
if (line6->disconnect)
- line6->disconnect(interface);
+ line6->disconnect(line6);
dev_info(&interface->dev, "Line 6 %s now disconnected\n",
line6->properties->name);
int message_length;
void (*process_message)(struct usb_line6 *);
- void (*disconnect)(struct usb_interface *);
+ void (*disconnect)(struct usb_line6 *line6);
};
extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1,
size_t datalen);
int line6_probe(struct usb_interface *interface,
+ const struct usb_device_id *id,
struct usb_line6 *line6,
const struct line6_properties *properties,
- int (*private_init)(struct usb_interface *, struct usb_line6 *));
+ int (*private_init)(struct usb_line6 *, const struct usb_device_id *id));
+
void line6_disconnect(struct usb_interface *interface);
#ifdef CONFIG_PM
/*
POD device disconnected.
*/
-static void line6_pod_disconnect(struct usb_interface *interface)
+static void line6_pod_disconnect(struct usb_line6 *line6)
{
- struct usb_line6_pod *pod = usb_get_intfdata(interface);
- struct device *dev = &interface->dev;
+ struct usb_line6_pod *pod = (struct usb_line6_pod *)line6;
+ struct device *dev = line6->ifcdev;
/* remove sysfs entries: */
device_remove_file(dev, &dev_attr_device_id);
/*
Try to init POD device.
*/
-static int pod_init(struct usb_interface *interface,
- struct usb_line6 *line6)
+static int pod_init(struct usb_line6 *line6,
+ const struct usb_device_id *id)
{
int err;
struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;
INIT_WORK(&pod->startup_work, pod_startup4);
/* create sysfs entries: */
- err = pod_create_files2(&interface->dev);
+ err = pod_create_files2(line6->ifcdev);
if (err < 0)
return err;
pod = kzalloc(sizeof(*pod), GFP_KERNEL);
if (!pod)
return -ENODEV;
- return line6_probe(interface, &pod->line6,
+ return line6_probe(interface, id, &pod->line6,
&pod_properties_table[id->driver_info],
pod_init);
}
/*
Try to init POD HD device.
*/
-static int podhd_init(struct usb_interface *interface,
- struct usb_line6 *line6)
+static int podhd_init(struct usb_line6 *line6,
+ const struct usb_device_id *id)
{
int err;
podhd = kzalloc(sizeof(*podhd), GFP_KERNEL);
if (!podhd)
return -ENODEV;
- return line6_probe(interface, &podhd->line6,
+ return line6_probe(interface, id, &podhd->line6,
&podhd_properties_table[id->driver_info],
podhd_init);
}
/*
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))
/*
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);
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);
}
/*
Variax destructor.
*/
-static void line6_variax_disconnect(struct usb_interface *interface)
+static void line6_variax_disconnect(struct usb_line6 *line6)
{
- struct usb_line6_variax *variax;
-
- variax = usb_get_intfdata(interface);
+ struct usb_line6_variax *variax = (struct usb_line6_variax *)line6;
del_timer(&variax->startup_timer1);
del_timer(&variax->startup_timer2);
/*
Try to init workbench device.
*/
-static int variax_init(struct usb_interface *interface,
- struct usb_line6 *line6)
+static int variax_init(struct usb_line6 *line6,
+ const struct usb_device_id *id)
{
struct usb_line6_variax *variax = (struct usb_line6_variax *) line6;
int err;
variax = kzalloc(sizeof(*variax), GFP_KERNEL);
if (!variax)
return -ENODEV;
- return line6_probe(interface, &variax->line6,
+ return line6_probe(interface, id, &variax->line6,
&variax_properties_table[id->driver_info],
variax_init);
}