diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-16 10:29:28 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-16 10:29:28 +0200 |
commit | 056a695c15e83f4a85305482fadea67f76fb7528 (patch) | |
tree | 9d94794fa65bab3f8787605a2e3cf3ca4466b72f /common/partition.c | |
parent | be6790838d92ebe130f8b66637cef72e40a7b704 (diff) | |
download | barebox-056a695c15e83f4a85305482fadea67f76fb7528.tar.gz barebox-056a695c15e83f4a85305482fadea67f76fb7528.tar.xz |
implement flash protection
Diffstat (limited to 'common/partition.c')
-rw-r--r-- | common/partition.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/partition.c b/common/partition.c index b3b27d5ded..d420592863 100644 --- a/common/partition.c +++ b/common/partition.c @@ -44,6 +44,16 @@ static int part_erase(struct device_d *dev, size_t count, unsigned long offset) return -1; } +static int part_protect(struct device_d *dev, size_t count, unsigned long offset, int prot) +{ + 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; +} + static int part_memmap(struct device_d *dev, void **map, int flags) { struct partition *part = dev->type_data; @@ -98,6 +108,7 @@ struct driver_d part_driver = { .read = part_read, .write = part_write, .erase = part_erase, + .protect= part_protect, .memmap = part_memmap, }; |