From: Jagan Teki Date: Thu, 11 Feb 2016 00:38:08 +0530 Subject: [U-Boot] [PATCH v5 13/32] spi_flash: Use mtd_info operation for non-dm In-Reply-To: <1455131307-25406-1-git-send-email-jteki@openedev.com> References: <1455131307-25406-1-git-send-email-jteki@openedev.com> Message-ID: <1455131307-25406-14-git-send-email-jteki@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Since non-dm code in m25p80 handling spi_nor along with mtd, hence use the mtd_info operation from user commands instead of legacy spi_flash{} ops. Cc: Simon Glass Cc: Bin Meng Cc: Mugunthan V N Cc: Michal Simek Cc: Siva Durga Prasad Paladugu Signed-off-by: Jagan Teki --- include/spi_flash.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/include/spi_flash.h b/include/spi_flash.h index 719a6e3..77939bd 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -191,7 +191,9 @@ int sandbox_sf_bind_emul(struct sandbox_state *state, int busnum, int cs, void sandbox_sf_unbind_emul(struct sandbox_state *state, int busnum, int cs); -#elif CONFIG_MTD_DM_SPI_NOR +#endif + +#ifdef CONFIG_MTD_DM_SPI_NOR typedef struct mtd_info spi_flash_t; @@ -254,24 +256,7 @@ struct spi_flash *spi_flash_probe_fdt(const void *blob, int slave_node, void spi_flash_free(struct spi_flash *flash); -static inline int spi_flash_read(struct spi_flash *flash, u32 offset, - size_t len, void *buf) -{ - return flash->read(flash, offset, len, buf); -} - -static inline int spi_flash_write(struct spi_flash *flash, u32 offset, - size_t len, const void *buf) -{ - return flash->write(flash, offset, len, buf); -} - -static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, - size_t len) -{ - return flash->erase(flash, offset, len); -} -#endif +#endif /* CONFIG_MTD_DM_SPI_NOR */ void spi_boot(void) __noreturn; void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst); -- 1.9.1