diff options
Diffstat (limited to 'drivers/staging/line6')
-rw-r--r-- | drivers/staging/line6/config.h | 48 | ||||
-rw-r--r-- | drivers/staging/line6/driver.c | 89 | ||||
-rw-r--r-- | drivers/staging/line6/midi.c | 2 | ||||
-rw-r--r-- | drivers/staging/line6/midibuf.c | 2 | ||||
-rw-r--r-- | drivers/staging/line6/pcm.c | 2 |
5 files changed, 20 insertions, 123 deletions
diff --git a/drivers/staging/line6/config.h b/drivers/staging/line6/config.h deleted file mode 100644 index f8a5149e3dad..000000000000 --- a/drivers/staging/line6/config.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Line6 Linux USB driver - 0.8.0 - * - * Copyright (C) 2004-2009 Markus Grabner (grabner@icg.tugraz.at) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#ifndef CONFIG_H -#define CONFIG_H - - -#ifdef CONFIG_USB_DEBUG -#define DEBUG 1 -#endif - - -/* - * Development tools. - */ -#define DO_DEBUG_MESSAGES 0 -#define DO_DUMP_URB_SEND DO_DEBUG_MESSAGES -#define DO_DUMP_URB_RECEIVE DO_DEBUG_MESSAGES -#define DO_DUMP_PCM_SEND 0 -#define DO_DUMP_PCM_RECEIVE 0 -#define DO_DUMP_MIDI_SEND DO_DEBUG_MESSAGES -#define DO_DUMP_MIDI_RECEIVE DO_DEBUG_MESSAGES -#define DO_DUMP_ANY (DO_DUMP_URB_SEND || DO_DUMP_URB_RECEIVE || \ - DO_DUMP_PCM_SEND || DO_DUMP_PCM_RECEIVE || \ - DO_DUMP_MIDI_SEND || DO_DUMP_MIDI_RECEIVE) -#define CREATE_RAW_FILE 0 - -#if DO_DEBUG_MESSAGES -#define CHECKPOINT printk(KERN_INFO "line6usb: %s (%s:%d)\n", \ - __func__, __FILE__, __LINE__) -#endif - -#if DO_DEBUG_MESSAGES -#define DEBUG_MESSAGES(x) (x) -#else -#define DEBUG_MESSAGES(x) -#endif - - -#endif diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index 2e602e192b07..4513f78f1127 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -92,15 +92,10 @@ const unsigned char line6_midi_id[] = { Code to request version of POD, Variax interface (and maybe other devices). */ -static const char line6_request_version0[] = { +static const char line6_request_version[] = { 0xf0, 0x7e, 0x7f, 0x06, 0x01, 0xf7 }; -/* - Copy of version request code with GFP_KERNEL flag for use in URB. -*/ -static const char *line6_request_version; - struct usb_line6 *line6_devices[LINE6_MAX_DEVICES]; /** @@ -336,8 +331,21 @@ int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer, */ int line6_version_request_async(struct usb_line6 *line6) { - return line6_send_raw_message_async(line6, line6_request_version, - sizeof(line6_request_version0)); + char *buffer; + int retval; + + buffer = kmalloc(sizeof(line6_request_version), GFP_ATOMIC); + if (buffer == NULL) { + dev_err(line6->ifcdev, "Out of memory"); + return -ENOMEM; + } + + memcpy(buffer, line6_request_version, sizeof(line6_request_version)); + + retval = line6_send_raw_message_async(line6, buffer, + sizeof(line6_request_version)); + kfree(buffer); + return retval; } /* @@ -1292,70 +1300,7 @@ static struct usb_driver line6_driver = { .id_table = line6_id_table, }; -/* - Module initialization. -*/ -static int __init line6_init(void) -{ - int i, retval; - - printk(KERN_INFO "%s driver version %s\n", DRIVER_NAME, DRIVER_VERSION); - - for (i = LINE6_MAX_DEVICES; i--;) - line6_devices[i] = NULL; - - retval = usb_register(&line6_driver); - - if (retval) { - printk(KERN_ERR KBUILD_MODNAME - ": usb_register failed. Error number %d\n", retval); - return retval; - } - - line6_request_version = kmalloc(sizeof(line6_request_version0), - GFP_KERNEL); - - if (line6_request_version == NULL) { - printk(KERN_ERR KBUILD_MODNAME ":Out of memory\n"); - return -ENOMEM; - } - - memcpy((char *)line6_request_version, line6_request_version0, - sizeof(line6_request_version0)); - - return retval; -} - -/* - Module cleanup. -*/ -static void __exit line6_exit(void) -{ - int i; - struct usb_line6 *line6; - struct snd_line6_pcm *line6pcm; - - /* stop all PCM channels */ - for (i = LINE6_MAX_DEVICES; i--;) { - line6 = line6_devices[i]; - - if (line6 == NULL) - continue; - - line6pcm = line6->line6pcm; - - if (line6pcm == NULL) - continue; - - line6_pcm_release(line6pcm, ~0); - } - - usb_deregister(&line6_driver); - kfree(line6_request_version); -} - -module_init(line6_init); -module_exit(line6_exit); +module_usb_driver(line6_driver); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c index 13d02939c3cb..50407294fbd4 100644 --- a/drivers/staging/line6/midi.c +++ b/drivers/staging/line6/midi.c @@ -406,7 +406,7 @@ int line6_init_midi(struct usb_line6 *line6) line6midi->line6 = line6; - switch(line6->product) { + switch (line6->product) { case LINE6_DEVID_PODHD300: case LINE6_DEVID_PODHD500: line6midi->midi_mask_transmit = 1; diff --git a/drivers/staging/line6/midibuf.c b/drivers/staging/line6/midibuf.c index 7b532e5ce8b4..836e8c847c52 100644 --- a/drivers/staging/line6/midibuf.c +++ b/drivers/staging/line6/midibuf.c @@ -64,7 +64,7 @@ int line6_midibuf_init(struct MidiBuffer *this, int size, int split) void line6_midibuf_status(struct MidiBuffer *this) { - printk(KERN_DEBUG "midibuf size=%d split=%d pos_read=%d pos_write=%d " + pr_debug("midibuf size=%d split=%d pos_read=%d pos_write=%d " "full=%d command_prev=%02x\n", this->size, this->split, this->pos_read, this->pos_write, this->full, this->command_prev); } diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c index 90d2d4475cb4..5e319e3ce685 100644 --- a/drivers/staging/line6/pcm.c +++ b/drivers/staging/line6/pcm.c @@ -99,7 +99,7 @@ int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int channels) unsigned long flags_new = flags_old | channels; unsigned long flags_final = flags_old; int err = 0; - + line6pcm->prev_fbuf = NULL; if (test_flags(flags_old, flags_new, LINE6_BITS_CAPTURE_BUFFER)) { |