return (retval < 0) ? retval : count;
}
-/*
- "read" request on "dump_buf" special file.
-*/
-static ssize_t pod_get_dump_buf(struct device *dev,
- struct device_attribute *attr, char *buf)
-{
- struct usb_interface *interface = to_usb_interface(dev);
- struct usb_line6_pod *pod = usb_get_intfdata(interface);
- int retval = line6_dump_wait_interruptible(&pod->dumpreq);
- if (retval < 0)
- return retval;
- memcpy(buf, &pod->prog_data_buf, sizeof(pod->prog_data_buf));
- return sizeof(pod->prog_data_buf);
-}
-
-/*
- "write" request on "dump_buf" special file.
-*/
-static ssize_t pod_set_dump_buf(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct usb_interface *interface = to_usb_interface(dev);
- struct usb_line6_pod *pod = usb_get_intfdata(interface);
-
- if (count != sizeof(pod->prog_data)) {
- dev_err(pod->line6.ifcdev,
- "data block must be exactly %d bytes\n",
- (int)sizeof(pod->prog_data));
- return -EINVAL;
- }
-
- memcpy(&pod->prog_data_buf, buf, sizeof(pod->prog_data));
- return sizeof(pod->prog_data);
-}
-
/*
"write" request on "finish" special file.
*/
/* POD special files: */
static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write);
-static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf,
- pod_set_dump_buf);
static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish);
static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version,
line6_nop_write);
int err;
CHECK_RETURN(device_create_file(dev, &dev_attr_device_id));
- CHECK_RETURN(device_create_file(dev, &dev_attr_dump_buf));
CHECK_RETURN(device_create_file(dev, &dev_attr_finish));
CHECK_RETURN(device_create_file(dev, &dev_attr_firmware_version));
CHECK_RETURN(device_create_file(dev, &dev_attr_midi_postprocess));
properties->device_bit, dev);
device_remove_file(dev, &dev_attr_device_id);
- device_remove_file(dev, &dev_attr_dump_buf);
device_remove_file(dev, &dev_attr_finish);
device_remove_file(dev, &dev_attr_firmware_version);
device_remove_file(dev, &dev_attr_midi_postprocess);