diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-13 14:37:13 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-08-13 16:52:15 +0200 |
commit | 9e64db63420d1f564053ac2a8ee7e43f07f602f4 (patch) | |
tree | 241bb5fff3e9ddbad61965f43ec1fd6c50b11f19 /common | |
parent | 1fbb5f65d63e077129ad94a2b19a394f90ee896b (diff) | |
download | barebox-9e64db63420d1f564053ac2a8ee7e43f07f602f4.tar.gz barebox-9e64db63420d1f564053ac2a8ee7e43f07f602f4.tar.xz |
Partition layer updates
- route MEMGETINFO through partition layer
- use dev_erase/dev_protect instead of direct pointers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/partition.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/common/partition.c b/common/partition.c index 4721bc1c13..8804fdb7c3 100644 --- a/common/partition.c +++ b/common/partition.c @@ -87,10 +87,7 @@ static int part_erase(struct device_d *dev, size_t count, unsigned long offset) { struct partition *part = dev->type_data; - if (part->physdev->driver->erase) - return part->physdev->driver->erase(part->physdev, count, offset + part->offset); - - return -1; + return dev_erase(part->physdev, count, offset + part->offset); } /** @@ -105,10 +102,7 @@ static int part_protect(struct device_d *dev, size_t count, unsigned long offset { struct partition *part = dev->type_data; - if (part->physdev->driver->protect) - return part->physdev->driver->protect(part->physdev, count, offset + part->offset, prot); - - return -1; + return dev_protect(part->physdev, count, offset + part->offset, prot); } /** @@ -131,7 +125,7 @@ static int part_memmap(struct device_d *dev, void **map, int flags) return 0; } - return -1; + return -ENOSYS; } /** @@ -203,6 +197,8 @@ static int part_ioctl(struct device_d *dev, int request, offset = (off_t)buf; offset += part->offset; return dev_ioctl(part->physdev, request, (void *)offset); + case MEMGETINFO: + return dev_ioctl(part->physdev, request, buf); } return -ENOSYS; |