X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fzorro%2Fzorro-sysfs.c;h=5290552d2ef7e0525f12f6fecfdbecd756088e7e;hb=e4ddcb0a6bf04d53ce77b4eb87bbbb32c4261d11;hp=87c29d7b6c17aa969356bd8a67fcefc8ac552615;hpb=4e57b6817880946a3a78d5d8cad1ace363f7e449;p=linux-2.6-omap-h63xx.git diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 87c29d7b6c1..5290552d2ef 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c @@ -42,24 +42,20 @@ static ssize_t zorro_show_resource(struct device *dev, struct device_attribute * struct zorro_dev *z = to_zorro_dev(dev); return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", - zorro_resource_start(z), zorro_resource_end(z), + (unsigned long)zorro_resource_start(z), + (unsigned long)zorro_resource_end(z), zorro_resource_flags(z)); } static DEVICE_ATTR(resource, S_IRUGO, zorro_show_resource, NULL); -static ssize_t zorro_read_config(struct kobject *kobj, char *buf, loff_t off, - size_t count) +static ssize_t zorro_read_config(struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) { struct zorro_dev *z = to_zorro_dev(container_of(kobj, struct device, kobj)); struct ConfigDev cd; - unsigned int size = sizeof(cd); - - if (off > size) - return 0; - if (off+count > size) - count = size-off; /* Construct a ConfigDev */ memset(&cd, 0, sizeof(cd)); @@ -69,15 +65,13 @@ static ssize_t zorro_read_config(struct kobject *kobj, char *buf, loff_t off, cd.cd_BoardAddr = (void *)zorro_resource_start(z); cd.cd_BoardSize = zorro_resource_len(z); - memcpy(buf, (void *)&cd+off, count); - return count; + return memory_read_from_buffer(buf, count, &off, &cd, sizeof(cd)); } static struct bin_attribute zorro_config_attr = { .attr = { .name = "config", - .mode = S_IRUGO | S_IWUSR, - .owner = THIS_MODULE + .mode = S_IRUGO, }, .size = sizeof(struct ConfigDev), .read = zorro_read_config,