Re: [PATCH] input: xpad.c - Xbox 360 wireless and sysfs support

From: Mike Murphy
Date: Tue Feb 17 2009 - 13:28:05 EST


On Mon, Feb 16, 2009 at 11:57 PM, Mike Murphy <mamurph@xxxxxxxxxxxxxx> wrote:
> Unless that is some common error that is obvious from its description,
> I will have to chase the bug down tomorrow or Wednesday. It's getting
> a bit late here.
>

Fixed... the function signature was wrong. Should have been:

static ssize_t xpad_show_dead_zone(struct device *dev, struct
device_attribute *attr, char *buf)

Incidentally, both Documentation/driver-model/device.txt and
Documentation/filesystems/sysfs.txt appear to be wrong. The former
defines the device attribute structure as:

struct device_attribute {
struct attribute attr;
ssize_t (*show)(struct device * dev, char * buf, size_t count,
loff_t off);
ssize_t (*store)(struct device * dev, const char * buf, size_t
count, loff_t off);
};

while the latter (that I followed last night) defines it as:

struct device_attribute {
struct attribute attr;
ssize_t (*show)(struct device * dev, char * buf);
ssize_t (*store)(struct device * dev, const char * buf);
};

I finally got the correct one out of include/linux/device.h:

struct device_attribute {
struct attribute attr;
ssize_t (*show)(struct device *dev, struct device_attribute *attr,
char *buf);
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count);
};

Thanks,
Mike
--
Mike Murphy
Ph.D. Candidate and NSF Graduate Research Fellow
Clemson University School of Computing
120 McAdams Hall
Clemson, SC 29634-0974 USA
Tel: +1 864.656.2838 Fax: +1 864.656.0145
http://cirg.cs.clemson.edu/~mamurph
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/