diff options
Diffstat (limited to 'platforms/astbmc/pnor.c')
-rw-r--r-- | platforms/astbmc/pnor.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/platforms/astbmc/pnor.c b/platforms/astbmc/pnor.c index d294c1f..634cb86 100644 --- a/platforms/astbmc/pnor.c +++ b/platforms/astbmc/pnor.c @@ -20,6 +20,7 @@ #include <opal.h> #include <libflash/libflash.h> #include <libflash/libffs.h> +#include <libflash/blocklevel.h> #include <ast.h> #include "astbmc.h" @@ -27,7 +28,7 @@ int pnor_init(void) { struct spi_flash_ctrl *pnor_ctrl; - struct flash_chip *pnor_chip = NULL; + struct blocklevel_device *bl; int rc; /* Open controller and flash. If the LPC->AHB doesn't point to @@ -44,19 +45,20 @@ int pnor_init(void) prerror("PLAT: Failed to open PNOR flash controller\n"); goto fail; } - rc = flash_init(pnor_ctrl, &pnor_chip); + + rc = flash_init(pnor_ctrl, &bl); if (rc) { prerror("PLAT: Failed to open init PNOR driver\n"); goto fail; } - rc = flash_register(pnor_chip, true); + rc = flash_register(bl, true); if (!rc) return 0; fail: - if (pnor_chip) - flash_exit(pnor_chip); + if (bl) + flash_exit(bl); if (pnor_ctrl) ast_sf_close(pnor_ctrl); |