From: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
To: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Cc: Rahul Bedarkar <rahul.bedarkar@imgtec.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
Marek Vasut <marek.vasut@gmail.com>,
Richard Weinberger <richard@nod.at>,
Cyrille Pitchen <cyrille.pitchen@atmel.com>
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 [thread overview]
Message-ID: <1489754636-21461-3-git-send-email-rahul.bedarkar@imgtec.com> (raw)
In-Reply-To: <1489754636-21461-1-git-send-email-rahul.bedarkar@imgtec.com>
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 <rahul.bedarkar@imgtec.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Cyrille Pitchen <cyrille.pitchen@atmel.com>
---
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
next prev parent reply other threads:[~2017-03-17 12:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 12:43 [RFC 0/6] Add user OTP support in SPI-NOR Rahul Bedarkar
2017-03-17 12:43 ` [RFC 1/6] Revert "mtd: spi-nor: remove unused read_xfer/write_xfer hooks" Rahul Bedarkar
2017-03-17 12:43 ` Rahul Bedarkar [this message]
2017-03-17 12:43 ` [RFC 3/6] mtd: m25p80: don't pass spi_nor to helper methods Rahul Bedarkar
2017-03-17 12:43 ` [RFC 4/6] mtd: m25p80: implement read_xfer and write_xfer Rahul Bedarkar
2017-03-17 12:43 ` [RFC 5/6] mtd: spi-nor: add support to read/write user OTP Rahul Bedarkar
2017-03-17 12:43 ` [RFC 6/6] mtd: spi-nor: enable OTP support for s25fl016k Rahul Bedarkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1489754636-21461-3-git-send-email-rahul.bedarkar@imgtec.com \
--to=rahul.bedarkar@imgtec.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@atmel.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).