From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Wed, 12 Dec 2018 21:31:16 +0100 Subject: [U-Boot] [PATCH 09/16] sf_mtd: Simply mtd operations In-Reply-To: <20181212173228.12281-10-vigneshr@ti.com> References: <20181212173228.12281-1-vigneshr@ti.com> <20181212173228.12281-10-vigneshr@ti.com> Message-ID: <20181212213116.433485c4@bbrezillon> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 12 Dec 2018 23:02:21 +0530 Vignesh R wrote: > @@ -39,13 +37,12 @@ static int spi_flash_mtd_erase(struct mtd_info *mtd, struct erase_info *instr) > static int spi_flash_mtd_read(struct mtd_info *mtd, loff_t from, size_t len, > size_t *retlen, u_char *buf) > { > - struct spi_flash *flash = mtd->priv; > int err; > > - if (!flash) > + if (!mtd || !mtd->priv) > return -ENODEV; > > - err = spi_flash_read(flash, from, len, buf); > + err = mtd->_read(mtd, from, len, retlen, buf); Please use the wrappers instead of calling those hooks directly.