Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751249AbdCQMpd (ORCPT ); Fri, 17 Mar 2017 08:45:33 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:54418 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbdCQMpa (ORCPT ); Fri, 17 Mar 2017 08:45:30 -0400 From: Rahul Bedarkar To: , CC: Rahul Bedarkar , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen Subject: [RFC 2/6] mtd: spi-nor: change return value of read_xfer and write_xfer Date: Fri, 17 Mar 2017 18:13:52 +0530 Message-ID: <1489754636-21461-3-git-send-email-rahul.bedarkar@imgtec.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1489754636-21461-1-git-send-email-rahul.bedarkar@imgtec.com> References: <1489754636-21461-1-git-send-email-rahul.bedarkar@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.91.23] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1533 Lines: 35 Change return value of read_xfer and write_xfer to allow returning amount of data transferred and errors as read(2)/write(2) does. This makes read_xfer/write_xfer inline with read/write hooks. Inspired-from: Commit 59451e1233bd ("mtd: spi-nor: change return value of read/write") Signed-off-by: Rahul Bedarkar Cc: David Woodhouse Cc: Brian Norris Cc: Boris Brezillon Cc: Marek Vasut Cc: Richard Weinberger Cc: Cyrille Pitchen --- include/linux/mtd/spi-nor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 0be3f86..64b4a54 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -223,9 +223,9 @@ struct spi_nor { int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops); void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops); - int (*read_xfer)(struct spi_nor *nor, struct spi_nor_xfer_cfg *cfg, + ssize_t (*read_xfer)(struct spi_nor *nor, struct spi_nor_xfer_cfg *cfg, u8 *buf, size_t len); - int (*write_xfer)(struct spi_nor *nor, struct spi_nor_xfer_cfg *cfg, + ssize_t (*write_xfer)(struct spi_nor *nor, struct spi_nor_xfer_cfg *cfg, u8 *buf, size_t len); int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len); -- 2.6.2