diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2015-12-18 10:42:18 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-01-08 11:33:12 +1100 |
commit | 42b13e5fdef8c9eaa21282092b92d9fa7df3e8bf (patch) | |
tree | 508353c87ac91bf165eb0fcde52e9d0e56ee5960 /libflash | |
parent | 813067acf74e6946aa7431ac9dafaf319a140ae5 (diff) | |
download | skiboot-42b13e5fdef8c9eaa21282092b92d9fa7df3e8bf.zip skiboot-42b13e5fdef8c9eaa21282092b92d9fa7df3e8bf.tar.gz skiboot-42b13e5fdef8c9eaa21282092b92d9fa7df3e8bf.tar.bz2 |
libffs: Remove unused function ffs_open_image()
The utility of this function has been superceeded by blocklevel code and is
no longer called from anywhere, it can be removed.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r-- | libflash/libffs.c | 82 | ||||
-rw-r--r-- | libflash/libffs.h | 6 |
2 files changed, 0 insertions, 88 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c index 631f9b8..f700da2 100644 --- a/libflash/libffs.c +++ b/libflash/libffs.c @@ -170,88 +170,6 @@ out: return rc; } -/* ffs_open_image is Linux only as it uses lseek, which skiboot does not - * implement */ -#ifndef __SKIBOOT__ -int ffs_open_image(int fd, uint32_t size, uint32_t toc_offset, - struct ffs_handle **ffsh) -{ - struct ffs_hdr hdr; - struct ffs_handle *f; - int rc; - - if (!ffsh) - return FLASH_ERR_PARM_ERROR; - *ffsh = NULL; - - if (fd < 0) - return FLASH_ERR_PARM_ERROR; - - if ((toc_offset + size) < toc_offset) - return FLASH_ERR_PARM_ERROR; - - /* Read flash header */ - rc = lseek(fd, toc_offset, SEEK_SET); - if (rc < 0) - return FLASH_ERR_PARM_ERROR; - - rc = read(fd, &hdr, sizeof(hdr)); - if (rc != sizeof(hdr)) - return FLASH_ERR_BAD_READ; - - /* Allocate ffs_handle structure and start populating */ - f = malloc(sizeof(*f)); - if (!f) - return FLASH_ERR_MALLOC_FAILED; - memset(f, 0, sizeof(*f)); - f->type = ffs_type_image; - f->toc_offset = toc_offset; - f->max_size = size; - - /* Convert and check flash header */ - rc = ffs_check_convert_header(&f->hdr, &hdr); - if (rc) { - FL_ERR("FFS: Error %d checking flash header\n", rc); - free(f); - return rc; - } - - /* - * Decide how much of the image to grab to get the whole - * partition map. - */ - f->cached_size = f->hdr.block_size * f->hdr.size; - FL_DBG("FFS: Partition map size: 0x%x\n", f->cached_size); - - /* Allocate cache */ - f->cache = malloc(f->cached_size); - if (!f->cache) { - free(f); - return FLASH_ERR_MALLOC_FAILED; - } - - /* Read the cached map */ - rc = lseek(fd, toc_offset, SEEK_SET); - if (rc < 0) { - free(f->cache); - free(f); - return FLASH_ERR_PARM_ERROR; - } - - rc = read(fd, f->cache, f->cached_size); - if (rc != f->cached_size) { - FL_ERR("FFS: Error %d reading flash partition map\n", rc); - free(f->cache); - free(f); - return FLASH_ERR_BAD_READ; - } - - *ffsh = f; - - return 0; -} -#endif /*!__SKIBOOT__*/ - void ffs_close(struct ffs_handle *ffs) { if (ffs->cache) diff --git a/libflash/libffs.h b/libflash/libffs.h index ddf3793..ab3f9b1 100644 --- a/libflash/libffs.h +++ b/libflash/libffs.h @@ -40,12 +40,6 @@ struct ffs_handle; int ffs_init(uint32_t offset, uint32_t max_size, struct blocklevel_device *bl, struct ffs_handle **ffs, int mark_ecc); -/* ffs_open_image is Linux only as it uses lseek, which skiboot does not - * implement */ -#ifndef __SKIBOOT__ -int ffs_open_image(int fd, uint32_t size, uint32_t toc_offset, - struct ffs_handle **ffs); -#endif void ffs_close(struct ffs_handle *ffs); |