staging: line6: drop midi_mask_receive
authorStefan Hajnoczi <stefanha@gmail.com>
Thu, 22 Nov 2012 19:49:03 +0000 (20:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2012 00:13:24 +0000 (16:13 -0800)
The midi_mask_receive sysfs attribute selects the MIDI channels on which
to receive messages.  There is no need to do this at the driver level,
instead the MIDI application endpoints decide which channels to use.
Other drivers don't implement midi_mask_receive so applications cannot
make use of this feature.  Therefore we drop it as part of the effort to
clean up the staging driver.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/line6/driver.c
drivers/staging/line6/midi.c
drivers/staging/line6/midi.h

index 0bc838d925149b7232618073d1c0703de5938893..e0e07798a637d0b345fe2187b601343649ff158d 100644 (file)
@@ -396,11 +396,6 @@ static void line6_data_received(struct urb *urb)
                if (done == 0)
                        break;
 
-               /* MIDI input filter */
-               if (line6_midibuf_skip_message
-                   (mb, line6->line6midi->midi_mask_receive))
-                       continue;
-
                line6->message_length = done;
                line6_midi_receive(line6, line6->buffer_message, done);
 
index c8e099bd0a4c41139634b23ee7c568e6c8faca86..c543c48b1ff1397545718216cea48001fecd406f 100644 (file)
@@ -313,42 +313,8 @@ static ssize_t midi_set_midi_mask_transmit(struct device *dev,
        return count;
 }
 
-/*
-       "read" request on "midi_mask_receive" special file.
-*/
-static ssize_t midi_get_midi_mask_receive(struct device *dev,
-                                         struct device_attribute *attr,
-                                         char *buf)
-{
-       struct usb_interface *interface = to_usb_interface(dev);
-       struct usb_line6 *line6 = usb_get_intfdata(interface);
-       return sprintf(buf, "%d\n", line6->line6midi->midi_mask_receive);
-}
-
-/*
-       "write" request on "midi_mask" special file.
-*/
-static ssize_t midi_set_midi_mask_receive(struct device *dev,
-                                         struct device_attribute *attr,
-                                         const char *buf, size_t count)
-{
-       struct usb_interface *interface = to_usb_interface(dev);
-       struct usb_line6 *line6 = usb_get_intfdata(interface);
-       unsigned short value;
-       int ret;
-
-       ret = kstrtou16(buf, 10, &value);
-       if (ret)
-               return ret;
-
-       line6->line6midi->midi_mask_receive = value;
-       return count;
-}
-
 static DEVICE_ATTR(midi_mask_transmit, S_IWUSR | S_IRUGO,
                   midi_get_midi_mask_transmit, midi_set_midi_mask_transmit);
-static DEVICE_ATTR(midi_mask_receive, S_IWUSR | S_IRUGO,
-                  midi_get_midi_mask_receive, midi_set_midi_mask_receive);
 
 /* MIDI device destructor */
 static int snd_line6_midi_free(struct snd_device *device)
@@ -356,8 +322,6 @@ static int snd_line6_midi_free(struct snd_device *device)
        struct snd_line6_midi *line6midi = device->device_data;
        device_remove_file(line6midi->line6->ifcdev,
                           &dev_attr_midi_mask_transmit);
-       device_remove_file(line6midi->line6->ifcdev,
-                          &dev_attr_midi_mask_receive);
        line6_midibuf_destroy(&line6midi->midibuf_in);
        line6_midibuf_destroy(&line6midi->midibuf_out);
        return 0;
@@ -404,12 +368,10 @@ int line6_init_midi(struct usb_line6 *line6)
        case LINE6_DEVID_PODHD300:
        case LINE6_DEVID_PODHD500:
                line6midi->midi_mask_transmit = 1;
-               line6midi->midi_mask_receive = 1;
                break;
 
        default:
                line6midi->midi_mask_transmit = 1;
-               line6midi->midi_mask_receive = 4;
        }
 
        line6->line6midi = line6midi;
@@ -429,10 +391,6 @@ int line6_init_midi(struct usb_line6 *line6)
        if (err < 0)
                return err;
 
-       err = device_create_file(line6->ifcdev, &dev_attr_midi_mask_receive);
-       if (err < 0)
-               return err;
-
        init_waitqueue_head(&line6midi->send_wait);
        spin_lock_init(&line6midi->send_urb_lock);
        spin_lock_init(&line6midi->midi_transmit_lock);
index 4a9e9f947297af8f6e9398aab66de4ac2396fc30..cf32d777ce620c327e9fa82488c592610e443dd6 100644 (file)
@@ -59,11 +59,6 @@ struct snd_line6_midi {
        */
        unsigned short midi_mask_transmit;
 
-       /**
-                Bit mask for input MIDI channels.
-       */
-       unsigned short midi_mask_receive;
-
        /**
                 Buffer for incoming MIDI stream.
        */