Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102393
b: refs/heads/master
c: fa7f289
h: refs/heads/master
i:
  102391: c6f0749
v: v3
  • Loading branch information
akinobu.mita@gmail.com authored and Linus Torvalds committed Jul 21, 2008
1 parent ca975cc commit e9e6325
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6a26a3e652671a783563f1e9697c68bd19c40fc
refs/heads/master: fa7f28939634c2ea36817a0c3dbd8d84972c1488
10 changes: 2 additions & 8 deletions trunk/drivers/zorro/zorro-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/zorro.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/fs.h>

#include "zorro.h"

Expand Down Expand Up @@ -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));
Expand All @@ -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 = {
Expand Down

0 comments on commit e9e6325

Please sign in to comment.