diff options
author | Chris Rorvick <chris@rorvick.com> | 2015-01-12 12:42:58 -0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-12 22:24:10 +0100 |
commit | 01f6b2bc6a40efa2d29b213e636b9208a8126318 (patch) | |
tree | 552b066d006c5b30bc2fd4c260b3969a581a51ae /drivers/staging/line6/variax.c | |
parent | 1cad3e8dcac92ee07c576e93d1b54c8308e2fa80 (diff) |
staging: line6: Call *_process_message() via pointer
Which *_process_message() function (if any) to call when data is
received is known at initialization. Add a function pointer to the
`usb_line6' struct and use to call into the appropriate logic instead
of evaluating the conditional logic for each message.
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/variax.c')
-rw-r--r-- | drivers/staging/line6/variax.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 4d419940a6bb..ccb1f689e335 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -130,7 +130,7 @@ static void variax_startup6(struct work_struct *work) /* Process a completely received message. */ -void line6_variax_process_message(struct usb_line6 *line6) +static void line6_variax_process_message(struct usb_line6 *line6) { struct usb_line6_variax *variax = (struct usb_line6_variax *) line6; const unsigned char *buf = variax->line6.buffer_message; @@ -180,6 +180,8 @@ static int variax_try_init(struct usb_interface *interface, struct usb_line6_variax *variax = (struct usb_line6_variax *) line6; int err; + line6->process_message = line6_variax_process_message; + init_timer(&variax->startup_timer1); init_timer(&variax->startup_timer2); INIT_WORK(&variax->startup_work, variax_startup6); |