summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-10-11 22:00:22 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-10-11 22:00:22 +0200
commit212f631eb441b9ae2d154b6503b9083a1fda3e5b (patch)
tree984b52b571e8be6b0b38c29cf9ca6057f6bfbcf3
parent82e54558b2cdbe2b95a7eb7986059931b4518f3d (diff)
downloadbarebox-212f631eb441b9ae2d154b6503b9083a1fda3e5b.tar.gz
let erase and protect functions return int instead of size_t. They
only return succes/error but no size.
-rw-r--r--include/driver.h6
-rw-r--r--lib/driver.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/include/driver.h b/include/driver.h
index e1b344c..018bbac 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -54,7 +54,7 @@ struct driver_d {
int (*remove)(struct device_d *);
ssize_t (*read) (struct device_d*, void* buf, size_t count, ulong offset, ulong flags);
ssize_t (*write) (struct device_d*, const void* buf, size_t count, ulong offset, ulong flags);
- ssize_t (*erase) (struct device_d*, size_t count, unsigned long offset);
+ int (*erase) (struct device_d*, size_t count, unsigned long offset);
int (*protect)(struct device_d*, size_t count, unsigned long offset, int prot);
int (*memmap)(struct device_d*, void **map, int flags);
@@ -109,8 +109,8 @@ struct driver_d *get_driver_by_name(const char *name);
ssize_t dev_read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
ssize_t dev_write(struct device_d *dev, const void *buf, size_t count, ulong offset, ulong flags);
-ssize_t dev_erase(struct device_d *dev, size_t count, unsigned long offset);
-ssize_t dev_protect(struct device_d *dev, size_t count, unsigned long offset, int prot);
+int dev_erase(struct device_d *dev, size_t count, unsigned long offset);
+int dev_protect(struct device_d *dev, size_t count, unsigned long offset, int prot);
int dev_memmap(struct device_d *dev, void **map, int flags);
/* These are used by drivers which work with direct memory accesses */
diff --git a/lib/driver.c b/lib/driver.c
index 0c560aa..1d1e59b 100644
--- a/lib/driver.c
+++ b/lib/driver.c
@@ -211,7 +211,7 @@ ssize_t dev_write(struct device_d *dev, const void *buf, size_t count, unsigned
return -ENOSYS;
}
-ssize_t dev_erase(struct device_d *dev, size_t count, unsigned long offset)
+int dev_erase(struct device_d *dev, size_t count, unsigned long offset)
{
if (dev->driver->erase)
return dev->driver->erase(dev, count, offset);
@@ -227,7 +227,7 @@ int dev_protect(struct device_d *dev, size_t count, unsigned long offset, int pr
return -ENOSYS;
}
-ssize_t dev_memmap(struct device_d *dev, void **map, int flags)
+int dev_memmap(struct device_d *dev, void **map, int flags)
{
if (dev->driver->memmap)
return dev->driver->memmap(dev, map, flags);