As the code is in the kernel tree, it's no longer needed.
Cc: Markus Grabner <grabner@icg.tugraz.at>
Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#define CHECKPOINT printk("line6usb: %s (%s:%d)\n", __FUNCTION__, __FILE__, __LINE__)
#endif
-/**
- In Linux 2.6.13 and later, the device_attribute is passed to the sysfs
- get/set functions (see /usr/src/linux/include/linux/device.h).
-*/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
-#define DEVICE_ATTRIBUTE struct device_attribute *attr,
-#else
-#define DEVICE_ATTRIBUTE
-#endif
-
/**
In Linux 2.6.20 and later, the pt_regs is no longer passed to USB callback
functions.
struct device_attribute dev_attr_##_name1 = __ATTR(_name2,_mode,_show,_store)
#define LINE6_PARAM_R(PREFIX, prefix, type, param) \
-static ssize_t prefix ## _get_ ## param(struct device *dev, DEVICE_ATTRIBUTE char *buf) \
+static ssize_t prefix ## _get_ ## param(struct device *dev, \
+ struct device_attribute *attr, char *buf) \
{ \
return prefix ## _get_param_ ## type(dev, buf, PREFIX ## _ ## param); \
}
#define LINE6_PARAM_RW(PREFIX, prefix, type, param) \
LINE6_PARAM_R(PREFIX, prefix, type, param); \
-static ssize_t prefix ## _set_ ## param(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count) \
+static ssize_t prefix ## _set_ ## param(struct device *dev, \
+ struct device_attribute *attr, const char *buf, size_t count) \
{ \
return prefix ## _set_param_ ## type(dev, buf, count, PREFIX ## _ ## param); \
}
/*
No operation (i.e., unsupported).
*/
-ssize_t line6_nop_read(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+ssize_t line6_nop_read(struct device *dev, struct device_attribute *attr,
+ char *buf)
{
return 0;
}
/*
No operation (i.e., unsupported).
*/
-ssize_t line6_nop_write(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+ssize_t line6_nop_write(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
{
return count;
}
"write" request on "raw" special file.
*/
#if CREATE_RAW_FILE
-ssize_t line6_set_raw(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+ssize_t line6_set_raw(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);
extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, int code2, int size);
-extern ssize_t line6_nop_read(struct device *dev, DEVICE_ATTRIBUTE char *buf);
-extern ssize_t line6_nop_write(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count);
+extern ssize_t line6_nop_read(struct device *dev, struct device_attribute *attr, char *buf);
+extern ssize_t line6_nop_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count);
extern int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t datalen);
extern int line6_read_serial_number(struct usb_line6 *line6, int *serial_number);
extern int line6_send_program(struct usb_line6 *line6, int value);
extern int line6_send_raw_message(struct usb_line6 *line6, const char *buffer, int size);
extern int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer, int size);
extern int line6_send_sysex_message(struct usb_line6 *line6, const char *buffer, int size);
-extern ssize_t line6_set_raw(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count);
+extern ssize_t line6_set_raw(struct device *dev, struct device_attribute *attr, const char *buf, size_t count);
extern int line6_transmit_parameter(struct usb_line6 *line6, int param, int value);
extern int line6_write_data(struct usb_line6 *line6, int address, void *data, size_t datalen);
extern void line6_write_hexdump(struct usb_line6 *line6, char dir, const unsigned char *buffer, int size);
/*
"read" request on "midi_mask_transmit" special file.
*/
-static ssize_t midi_get_midi_mask_transmit(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t midi_get_midi_mask_transmit(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);
/*
"write" request on "midi_mask" special file.
*/
-static ssize_t midi_set_midi_mask_transmit(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t midi_set_midi_mask_transmit(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);
/*
"read" request on "midi_mask_receive" special file.
*/
-static ssize_t midi_get_midi_mask_receive(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+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);
/*
"write" request on "midi_mask" special file.
*/
-static ssize_t midi_set_midi_mask_receive(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+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);
/*
"read" request on "channel" special file.
*/
-static ssize_t pod_get_channel(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_channel(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);
/*
"write" request on "channel" special file.
*/
-static ssize_t pod_set_channel(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_channel(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);
/*
"read" request on "name" special file.
*/
-static ssize_t pod_get_name(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_name(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);
/*
"read" request on "name" special file.
*/
-static ssize_t pod_get_name_buf(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_name_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);
/*
"read" request on "dump" special file.
*/
-static ssize_t pod_get_dump(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_dump(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);
/*
"write" request on "dump" special file.
*/
-static ssize_t pod_set_dump(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_dump(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);
/*
"read" request on "dump_buf" special file.
*/
-static ssize_t pod_get_dump_buf(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+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);
/*
"write" request on "dump_buf" special file.
*/
-static ssize_t pod_set_dump_buf(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+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);
/*
"write" request on "finish" special file.
*/
-static ssize_t pod_set_finish(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_finish(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);
/*
"write" request on "store_channel" special file.
*/
-static ssize_t pod_set_store_channel(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_store_channel(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
return pod_send_store_command(dev, buf, count, 0x0000, 0x00c0);
}
/*
"write" request on "store_effects_setup" special file.
*/
-static ssize_t pod_set_store_effects_setup(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_store_effects_setup(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
return pod_send_store_command(dev, buf, count, 0x0080, 0x0080);
}
/*
"write" request on "store_amp_setup" special file.
*/
-static ssize_t pod_set_store_amp_setup(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_store_amp_setup(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
return pod_send_store_command(dev, buf, count, 0x0040, 0x0100);
}
/*
"write" request on "retrieve_channel" special file.
*/
-static ssize_t pod_set_retrieve_channel(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_retrieve_channel(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
return pod_send_retrieve_command(dev, buf, count, 0x0000, 0x00c0);
}
/*
"write" request on "retrieve_effects_setup" special file.
*/
-static ssize_t pod_set_retrieve_effects_setup(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_retrieve_effects_setup(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
return pod_send_retrieve_command(dev, buf, count, 0x0080, 0x0080);
}
/*
"write" request on "retrieve_amp_setup" special file.
*/
-static ssize_t pod_set_retrieve_amp_setup(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_retrieve_amp_setup(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
return pod_send_retrieve_command(dev, buf, count, 0x0040, 0x0100);
}
/*
"read" request on "dirty" special file.
*/
-static ssize_t pod_get_dirty(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_dirty(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);
/*
"read" request on "midi_postprocess" special file.
*/
-static ssize_t pod_get_midi_postprocess(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_midi_postprocess(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);
/*
"write" request on "midi_postprocess" special file.
*/
-static ssize_t pod_set_midi_postprocess(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t pod_set_midi_postprocess(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);
/*
"read" request on "serial_number" special file.
*/
-static ssize_t pod_get_serial_number(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_serial_number(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);
/*
"read" request on "firmware_version" special file.
*/
-static ssize_t pod_get_firmware_version(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_firmware_version(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);
/*
"read" request on "device_id" special file.
*/
-static ssize_t pod_get_device_id(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_get_device_id(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);
/*
"read" request on "clip" special file.
*/
-static ssize_t pod_wait_for_clip(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t pod_wait_for_clip(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);
}
#define POD_GET_SYSTEM_PARAM(code, tuner, sign) \
-static ssize_t pod_get_ ## code(struct device *dev, DEVICE_ATTRIBUTE char *buf) \
+static ssize_t pod_get_ ## code(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); \
#define POD_GET_SET_SYSTEM_PARAM(code, mask, tuner, sign) \
POD_GET_SYSTEM_PARAM(code, tuner, sign) \
-static ssize_t pod_set_ ## code(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count) \
+static ssize_t pod_set_ ## code(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); \
(line6 = &tp->line6))
toneport_send_cmd(line6->usbdev, (led_red<<8)|0x0002, led_green); // for setting the LED on Guitarport
}
-static ssize_t toneport_set_led_red(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count) {
+static ssize_t toneport_set_led_red(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count) {
char* c;
led_red = simple_strtol(buf, &c, 10);
toneport_update_led(dev);
return count;
}
-static ssize_t toneport_set_led_green(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count) {
+static ssize_t toneport_set_led_green(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count) {
char* c;
led_green = simple_strtol(buf, &c, 10);
toneport_update_led(dev);
/*
"read" request on "volume" special file.
*/
-static ssize_t variax_get_volume(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_volume(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
return sprintf(buf, "%d\n", variax->volume);
/*
"write" request on "volume" special file.
*/
-static ssize_t variax_set_volume(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t variax_set_volume(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10);
/*
"read" request on "model" special file.
*/
-static ssize_t variax_get_model(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_model(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
return sprintf(buf, "%d\n", variax->model);
/*
"write" request on "model" special file.
*/
-static ssize_t variax_set_model(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t variax_set_model(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata( to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10);
/*
"read" request on "active" special file.
*/
-static ssize_t variax_get_active(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_active(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
return sprintf(buf, "%d\n", variax->buffer_activate[VARIAX_OFFSET_ACTIVATE]);
/*
"write" request on "active" special file.
*/
-static ssize_t variax_set_active(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t variax_set_active(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10) ? 1 : 0;
/*
"read" request on "tone" special file.
*/
-static ssize_t variax_get_tone(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_tone(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
return sprintf(buf, "%d\n", variax->tone);
/*
"write" request on "tone" special file.
*/
-static ssize_t variax_set_tone(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t variax_set_tone(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int value = simple_strtoul(buf, NULL, 10);
/*
"read" request on "name" special file.
*/
-static ssize_t variax_get_name(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_name(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
line6_wait_dump(&variax->dumpreq, 0);
/*
"read" request on "bank" special file.
*/
-static ssize_t variax_get_bank(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_bank(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
line6_wait_dump(&variax->dumpreq, 0);
/*
"read" request on "dump" special file.
*/
-static ssize_t variax_get_dump(struct device *dev, DEVICE_ATTRIBUTE char *buf)
+static ssize_t variax_get_dump(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int retval;
/*
"write" request on "raw" special file.
*/
-static ssize_t variax_set_raw2(struct device *dev, DEVICE_ATTRIBUTE const char *buf, size_t count)
+static ssize_t variax_set_raw2(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
{
struct usb_line6_variax *variax = usb_get_intfdata(to_usb_interface(dev));
int size;