Commit 77491e52 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: line6: remove DEVICE_ATTRIBUTE

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7e60fcb5
......@@ -43,16 +43,6 @@
#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.
......
......@@ -22,14 +22,16 @@
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); \
}
......
......@@ -556,7 +556,8 @@ int line6_read_serial_number(struct usb_line6 *line6, int *serial_number)
/*
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;
}
......@@ -564,7 +565,8 @@ ssize_t line6_nop_read(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
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;
}
......@@ -573,7 +575,8 @@ ssize_t line6_nop_write(struct device *dev, DEVICE_ATTRIBUTE const char *buf, si
"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);
......
......@@ -173,15 +173,15 @@ struct usb_line6 {
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);
......
......@@ -287,7 +287,9 @@ static int snd_line6_new_midi(struct snd_line6_midi *line6midi)
/*
"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);
......@@ -297,7 +299,9 @@ static ssize_t midi_get_midi_mask_transmit(struct device *dev, DEVICE_ATTRIBUTE
/*
"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);
......@@ -309,7 +313,9 @@ static ssize_t midi_set_midi_mask_transmit(struct device *dev, DEVICE_ATTRIBUTE
/*
"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);
......@@ -319,7 +325,9 @@ static ssize_t midi_get_midi_mask_receive(struct device *dev, DEVICE_ATTRIBUTE c
/*
"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);
......
This diff is collapsed.
......@@ -91,13 +91,17 @@ static void toneport_update_led(struct device *dev) {
(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);
......
......@@ -162,7 +162,8 @@ void variax_process_message(struct usb_line6_variax *variax)
/*
"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);
......@@ -171,7 +172,9 @@ static ssize_t variax_get_volume(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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);
......@@ -185,7 +188,8 @@ static ssize_t variax_set_volume(struct device *dev, DEVICE_ATTRIBUTE const char
/*
"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);
......@@ -194,7 +198,9 @@ static ssize_t variax_get_model(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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);
......@@ -208,7 +214,8 @@ static ssize_t variax_set_model(struct device *dev, DEVICE_ATTRIBUTE const char
/*
"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]);
......@@ -217,7 +224,9 @@ static ssize_t variax_get_active(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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;
......@@ -229,7 +238,8 @@ static ssize_t variax_set_active(struct device *dev, DEVICE_ATTRIBUTE const char
/*
"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);
......@@ -238,7 +248,9 @@ static ssize_t variax_get_tone(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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);
......@@ -268,7 +280,8 @@ static ssize_t get_string(char *buf, const char *data, int length)
/*
"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);
......@@ -278,7 +291,8 @@ static ssize_t variax_get_name(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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);
......@@ -288,7 +302,8 @@ static ssize_t variax_get_bank(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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;
......@@ -303,7 +318,9 @@ static ssize_t variax_get_dump(struct device *dev, DEVICE_ATTRIBUTE char *buf)
/*
"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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment