Skip to content

Commit

Permalink
ALSA: line6: Pass driver name to line6_probe()
Browse files Browse the repository at this point in the history
Provide a unique name for each driver instead of using "line6usb" for
all of them.  This will allow for different configurations based on the
driver type.

Signed-off-by: Chris Rorvick <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
crorvick authored and tiwai committed Feb 8, 2015
1 parent f2bd242 commit 12865ca
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion sound/usb/line6/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ static int line6_init_cap_control(struct usb_line6 *line6)
*/
int line6_probe(struct usb_interface *interface,
const struct usb_device_id *id,
const char *driver_name,
const struct line6_properties *properties,
int (*private_init)(struct usb_line6 *, const struct usb_device_id *id),
size_t data_size)
Expand Down Expand Up @@ -511,7 +512,7 @@ int line6_probe(struct usb_interface *interface,
line6->ifcdev = &interface->dev;

strcpy(card->id, properties->id);
strcpy(card->driver, DRIVER_NAME);
strcpy(card->driver, driver_name);
strcpy(card->shortname, properties->name);
sprintf(card->longname, "Line 6 %s at USB %s", properties->name,
dev_name(line6->ifcdev));
Expand Down
3 changes: 1 addition & 2 deletions sound/usb/line6/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#include "midi.h"

#define DRIVER_NAME "line6usb"

#define USB_INTERVALS_PER_SECOND 1000

/* Fallback USB interval and max packet size values */
Expand Down Expand Up @@ -168,6 +166,7 @@ extern int line6_write_data(struct usb_line6 *line6, int address, void *data,

int line6_probe(struct usb_interface *interface,
const struct usb_device_id *id,
const char *driver_name,
const struct line6_properties *properties,
int (*private_init)(struct usb_line6 *, const struct usb_device_id *id),
size_t data_size);
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/line6/pod.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static const struct line6_properties pod_properties_table[] = {
static int pod_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
return line6_probe(interface, id,
return line6_probe(interface, id, "Line6-POD",
&pod_properties_table[id->driver_info],
pod_init, sizeof(struct usb_line6_pod));
}
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/line6/podhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static const struct line6_properties podhd_properties_table[] = {
static int podhd_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
return line6_probe(interface, id,
return line6_probe(interface, id, "Line6-PODHD",
&podhd_properties_table[id->driver_info],
podhd_init, sizeof(struct usb_line6));
}
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/line6/toneport.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ static const struct line6_properties toneport_properties_table[] = {
static int toneport_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
return line6_probe(interface, id,
return line6_probe(interface, id, "Line6-TonePort",
&toneport_properties_table[id->driver_info],
toneport_init, sizeof(struct usb_line6_toneport));
}
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/line6/variax.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static const struct line6_properties variax_properties_table[] = {
static int variax_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
return line6_probe(interface, id,
return line6_probe(interface, id, "Line6-Variax",
&variax_properties_table[id->driver_info],
variax_init, sizeof(struct usb_line6_variax));
}
Expand Down

0 comments on commit 12865ca

Please sign in to comment.