aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2015-03-04 17:11:31 +1030
committerJeremy Kerr <jk@ozlabs.org>2015-03-04 22:57:43 +1100
commit29289f44e289afeb7eb7e7ce0687d787cebae90e (patch)
treee33230abc5c7496a07680f7dcc5246d0fc036021 /external
parent5ae13c25766b0025ffab99b9f8622182af2d4b36 (diff)
downloadskiboot-29289f44e289afeb7eb7e7ce0687d787cebae90e.zip
skiboot-29289f44e289afeb7eb7e7ce0687d787cebae90e.tar.gz
skiboot-29289f44e289afeb7eb7e7ce0687d787cebae90e.tar.bz2
external/opal-prd: Correct partition offset
The start of the partition was not used when sending the size to the mtd_{read,write} calls. This meant they were unconditionally reading and writing to the start of the flash, instead of the partition. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'external')
-rw-r--r--external/opal-prd/pnor.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/external/opal-prd/pnor.c b/external/opal-prd/pnor.c
index e40d292..3ae7fcd 100644
--- a/external/opal-prd/pnor.c
+++ b/external/opal-prd/pnor.c
@@ -294,18 +294,12 @@ int pnor_operation(struct pnor *pnor, const char *name, uint64_t offset,
return fd;
}
- rc = lseek(fd, pstart, SEEK_SET);
- if (rc < 0) {
- perror(pnor->path);
- goto out;
- }
-
switch (op) {
case PNOR_OP_READ:
- rc = mtd_read(pnor, fd, data, offset, size);
+ rc = mtd_read(pnor, fd, data, pstart + offset, size);
break;
case PNOR_OP_WRITE:
- rc = mtd_write(pnor, fd, data, offset, size);
+ rc = mtd_write(pnor, fd, data, pstart + offset, size);
break;
default:
rc = -EIO;