diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-21 15:06:09 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-21 15:06:09 +0200 |
commit | e66d90fb4abd0a27ee96f57a32fb561221c4d6ae (patch) | |
tree | 3337cba94c7444b06fdb0e8b487287d07b71f4a0 /drivers/zorro/zorro-sysfs.c | |
parent | 55ca089e2579de90f048aca2a3030b8b2f864813 (diff) | |
parent | 14b395e35d1afdd8019d11b92e28041fad591b71 (diff) |
Merge branch 'linus' into xen-64bit
Diffstat (limited to 'drivers/zorro/zorro-sysfs.c')
-rw-r--r-- | drivers/zorro/zorro-sysfs.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 808b4f8675c..3da712cc770 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c @@ -15,6 +15,7 @@ #include <linux/zorro.h> #include <linux/stat.h> #include <linux/string.h> +#include <linux/fs.h> #include "zorro.h" @@ -56,12 +57,6 @@ static ssize_t zorro_read_config(struct kobject *kobj, 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)); @@ -71,8 +66,7 @@ static ssize_t zorro_read_config(struct kobject *kobj, 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 = { |