From 813067acf74e6946aa7431ac9dafaf319a140ae5 Mon Sep 17 00:00:00 2001 From: Cyril Bur Date: Fri, 18 Dec 2015 10:42:17 +1100 Subject: external/opal-prd: Drop final use of ffs_open_image() ffs_open_image() is only called from one place and its function has been superseded by the blocklevel_device interface to access files/mtd/flash. Ultimately it looks like opal-prd should be converted to use the full set of features provided by blocklevel but for now this patch allows code to be ripped out of libffs. Signed-off-by: Cyril Bur Signed-off-by: Stewart Smith --- external/opal-prd/pnor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'external/opal-prd') diff --git a/external/opal-prd/pnor.c b/external/opal-prd/pnor.c index 43814ab8..7c986034 100644 --- a/external/opal-prd/pnor.c +++ b/external/opal-prd/pnor.c @@ -33,6 +33,7 @@ int pnor_init(struct pnor *pnor) { int rc, fd; + struct blocklevel_device *bl; mtd_info_t mtd_info; if (!pnor) @@ -67,10 +68,17 @@ int pnor_init(struct pnor *pnor) pr_debug("PNOR: Found PNOR: %d bytes (%d blocks)", pnor->size, pnor->erasesize); - rc = ffs_open_image(fd, pnor->size, 0, &pnor->ffsh); + rc = file_init(fd, &bl); + if (rc) { + pr_log(LOG_ERR, "PNOR: (libflash) file_init() failed"); + goto out; + } + + rc = ffs_init(0, pnor->size, 0, bl, &pnor->ffsh, 0); if (rc) pr_log(LOG_ERR, "PNOR: Failed to open pnor partition table"); + file_exit(bl); out: close(fd); -- cgit v1.2.1