public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Mike Dunn <mikedunn@newsguy.com>
Subject: [PATCH 15/28] mtd: introduce mtd_read_user_prot_reg interface
Date: Fri, 23 Dec 2011 20:11:07 +0200	[thread overview]
Message-ID: <1324663880-22477-16-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1324663880-22477-1-git-send-email-dedekind1@gmail.com>

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 drivers/mtd/mtdchar.c   |    3 ++-
 drivers/mtd/mtdpart.c   |    3 +--
 include/linux/mtd/mtd.h |   10 +++++++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 80c342c..4941e58 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -217,7 +217,8 @@ static ssize_t mtdchar_read(struct file *file, char __user *buf, size_t count,
 						     &retlen, kbuf);
 			break;
 		case MTD_FILE_MODE_OTP_USER:
-			ret = mtd->read_user_prot_reg(mtd, *ppos, len, &retlen, kbuf);
+			ret = mtd_read_user_prot_reg(mtd, *ppos, len,
+						     &retlen, kbuf);
 			break;
 		case MTD_FILE_MODE_RAW:
 		{
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index bf1ab56..f018373 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -152,8 +152,7 @@ static int part_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
 		size_t len, size_t *retlen, u_char *buf)
 {
 	struct mtd_part *part = PART(mtd);
-	return part->master->read_user_prot_reg(part->master, from,
-					len, retlen, buf);
+	return mtd_read_user_prot_reg(part->master, from, len, retlen, buf);
 }
 
 static int part_get_user_prot_info(struct mtd_info *mtd,
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index ff0a3a1..855fb7f 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -198,13 +198,14 @@ struct mtd_info {
 				   size_t len, size_t *retlen, u_char *buf);
 	int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf,
 				   size_t len);
+	int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from,
+				   size_t len, size_t *retlen, u_char *buf);
 
 	/* Backing device capabilities for this device
 	 * - provides mmap capabilities
 	 */
 	struct backing_dev_info *backing_dev_info;
 
-	int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 	int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 	int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
 
@@ -353,6 +354,13 @@ static inline int mtd_get_user_prot_info(struct mtd_info *mtd,
 	return mtd->get_user_prot_info(mtd, buf, len);
 }
 
+static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
+					 size_t len, size_t *retlen,
+					 u_char *buf)
+{
+	return mtd->read_user_prot_reg(mtd, from, len, retlen, buf);
+}
+
 static inline struct mtd_info *dev_to_mtd(struct device *dev)
 {
 	return dev ? dev_get_drvdata(dev) : NULL;
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-23 18:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23 18:10 [PATCH 00/28] introduce wrappers for mtd interfaces Artem Bityutskiy
2011-12-23 18:10 ` [PATCH 01/28] logfs: rename functions starting with mtd_ Artem Bityutskiy
2011-12-23 18:10 ` [PATCH 02/28] mtd: mtdchar: rename functions Artem Bityutskiy
2011-12-23 18:10 ` [PATCH 03/28] mtd: introduce mtd_erase interface Artem Bityutskiy
2011-12-27  9:22   ` Mike Frysinger
2011-12-27  9:37     ` Artem Bityutskiy
2011-12-27  9:47       ` Artem Bityutskiy
2011-12-27  9:50         ` Mike Frysinger
2011-12-23 18:10 ` [PATCH 04/28] mtd: introduce mtd_point interface Artem Bityutskiy
2011-12-23 18:10 ` [PATCH 05/28] mtd: introduce mtd_unpoint interface Artem Bityutskiy
2011-12-23 18:10 ` [PATCH 06/28] mtd: introduce mtd_get_unmapped_area interface Artem Bityutskiy
2011-12-23 18:10 ` [PATCH 07/28] mtd: introduce mtd_read interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 08/28] mtd: introduce mtd_write interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 09/28] mtd: introduce mtd_panic_write interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 10/28] mtd: introduce mtd_read_oob interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 11/28] mtd: introduce mtd_write_oob interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 12/28] mtd: introduce mtd_get_fact_prot_info interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 13/28] mtd: introduce mtd_read_fact_prot_reg interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 14/28] mtd: introduce mtd_get_user_prot_info interface Artem Bityutskiy
2011-12-23 18:11 ` Artem Bityutskiy [this message]
2011-12-23 18:11 ` [PATCH 16/28] mtd: introduce mtd_write_user_prot_reg interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 17/28] mtd: introduce mtd_lock_user_prot_reg interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 18/28] mtd: introduce mtd_writev interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 19/28] mtd: introduce mtd_sync interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 20/28] mtd: introduce mtd_lock interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 21/28] mtd: introduce mtd_unlock interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 22/28] mtd: introduce mtd_is_locked interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 23/28] mtd: introduce mtd_suspend interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 24/28] mtd: introduce mtd_resume interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 25/28] " Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 26/28] mtd: introduce mtd_block_markbad interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 27/28] mtd: introduce mtd_get_device interface Artem Bityutskiy
2011-12-23 18:11 ` [PATCH 28/28] mtd: introduce mtd_put_device interface Artem Bityutskiy
2011-12-25 14:50 ` [PATCH 00/28] introduce wrappers for mtd interfaces Mike Dunn
2011-12-25 18:51   ` Artem Bityutskiy

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=1324663880-22477-16-git-send-email-dedekind1@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mikedunn@newsguy.com \
    /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