aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/line6/pcm.c
diff options
context:
space:
mode:
authorChris Rorvick <chris@rorvick.com>2015-01-12 12:42:42 -0800
committerTakashi Iwai <tiwai@suse.de>2015-01-12 22:24:01 +0100
commita23a8bff1535ddf2f7b9f358f3eb47973d757c54 (patch)
tree64b379b32a3b0f33fca21b8ec1296d6a9873f2ae /drivers/staging/line6/pcm.c
parentstaging: line6: Index properties array with device type (diff)
downloadlinux-dev-a23a8bff1535ddf2f7b9f358f3eb47973d757c54.tar.xz
linux-dev-a23a8bff1535ddf2f7b9f358f3eb47973d757c54.zip
staging: line6: Key off of device type
The driver currently uses the device's idProduct as input to several switch statements. In some cases this is not sufficiently granular and the interface number must be taken into account. Store the device type in `usb_line6' and key off of it instead. New types can then be added that map to specific interfaces on the device so that this conditional logic can be flattened out. Signed-off-by: Chris Rorvick <chris@rorvick.com> Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/staging/line6/pcm.c')
-rw-r--r--drivers/staging/line6/pcm.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c
index 076c87b689d0..86c7bcba7ad6 100644
--- a/drivers/staging/line6/pcm.c
+++ b/drivers/staging/line6/pcm.c
@@ -427,37 +427,37 @@ int line6_init_pcm(struct usb_line6 *line6,
if (!(line6->properties->capabilities & LINE6_BIT_PCM))
return 0; /* skip PCM initialization and report success */
- /* initialize PCM subsystem based on product id: */
- switch (line6->product) {
- case LINE6_DEVID_BASSPODXT:
- case LINE6_DEVID_BASSPODXTLIVE:
- case LINE6_DEVID_BASSPODXTPRO:
- case LINE6_DEVID_PODXT:
- case LINE6_DEVID_PODXTLIVE:
- case LINE6_DEVID_PODXTPRO:
- case LINE6_DEVID_PODHD300:
- case LINE6_DEVID_PODHD400:
+ /* initialize PCM subsystem based on device: */
+ switch (line6->type) {
+ case LINE6_BASSPODXT:
+ case LINE6_BASSPODXTLIVE:
+ case LINE6_BASSPODXTPRO:
+ case LINE6_PODXT:
+ case LINE6_PODXTLIVE:
+ case LINE6_PODXTPRO:
+ case LINE6_PODHD300:
+ case LINE6_PODHD400:
ep_read = 0x82;
ep_write = 0x01;
break;
- case LINE6_DEVID_PODHD500:
+ case LINE6_PODHD500:
ep_read = 0x86;
ep_write = 0x02;
break;
- case LINE6_DEVID_POCKETPOD:
+ case LINE6_POCKETPOD:
ep_read = 0x82;
ep_write = 0x02;
break;
- case LINE6_DEVID_GUITARPORT:
- case LINE6_DEVID_PODSTUDIO_GX:
- case LINE6_DEVID_PODSTUDIO_UX1:
- case LINE6_DEVID_PODSTUDIO_UX2:
- case LINE6_DEVID_TONEPORT_GX:
- case LINE6_DEVID_TONEPORT_UX1:
- case LINE6_DEVID_TONEPORT_UX2:
+ case LINE6_GUITARPORT:
+ case LINE6_PODSTUDIO_GX:
+ case LINE6_PODSTUDIO_UX1:
+ case LINE6_PODSTUDIO_UX2:
+ case LINE6_TONEPORT_GX:
+ case LINE6_TONEPORT_UX1:
+ case LINE6_TONEPORT_UX2:
ep_read = 0x82;
ep_write = 0x01;
break;