staging: line6: Key off of device type
authorChris Rorvick <chris@rorvick.com>
Mon, 12 Jan 2015 20:42:42 +0000 (12:42 -0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 12 Jan 2015 21:24:01 +0000 (22:24 +0100)
commita23a8bff1535ddf2f7b9f358f3eb47973d757c54
tree64b379b32a3b0f33fca21b8ec1296d6a9873f2ae
parentc33a20b71daf7e7d0d5746200621867ae44d09e9
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>
drivers/staging/line6/driver.c
drivers/staging/line6/driver.h
drivers/staging/line6/pcm.c
drivers/staging/line6/toneport.c