mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/6] mtd: rename mtd file operations callback functions
Date: Fri, 15 Feb 2013 09:04:55 +0100	[thread overview]
Message-ID: <1360915499-1659-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1360915499-1659-1-git-send-email-s.hauer@pengutronix.de>

These are currently named mtd_read/write/erase. Functions with
the same name exist as global functions in the kernel. Rename
them to mtd_op_* to avoid name clashes with future mtd updates.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/core.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 070fda6..40c522f 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -39,7 +39,7 @@ int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs)
 	return mtd->block_isbad(mtd, ofs);
 }
 
-static 	ssize_t mtd_read(struct cdev *cdev, void* buf, size_t count,
+static ssize_t mtd_op_read(struct cdev *cdev, void* buf, size_t count,
 			  loff_t _offset, ulong flags)
 {
 	struct mtd_info *mtd = cdev->priv;
@@ -47,7 +47,8 @@ static 	ssize_t mtd_read(struct cdev *cdev, void* buf, size_t count,
 	int ret;
 	unsigned long offset = _offset;
 
-	debug("mtd_read: 0x%08lx 0x%08x\n", offset, count);
+	dev_dbg(cdev->dev, "read ofs: 0x%08lx count: 0x%08x\n",
+			offset, count);
 
 	ret = mtd->read(mtd, offset, count, &retlen, buf);
 
@@ -62,7 +63,7 @@ static 	ssize_t mtd_read(struct cdev *cdev, void* buf, size_t count,
 #define MTDPGALG(x) ((x) & ~(mtd->writesize - 1))
 
 #ifdef CONFIG_MTD_WRITE
-static ssize_t mtd_write(struct cdev* cdev, const void *buf, size_t _count,
+static ssize_t mtd_op_write(struct cdev* cdev, const void *buf, size_t _count,
 			  loff_t _offset, ulong flags)
 {
 	struct mtd_info *mtd = cdev->priv;
@@ -74,7 +75,7 @@ static ssize_t mtd_write(struct cdev* cdev, const void *buf, size_t _count,
 	return ret ? ret : _count;
 }
 
-static int mtd_erase(struct cdev *cdev, size_t count, loff_t offset)
+static int mtd_op_erase(struct cdev *cdev, size_t count, loff_t offset)
 {
 	struct mtd_info *mtd = cdev->priv;
 	struct erase_info erase;
@@ -130,7 +131,7 @@ int mtd_ioctl(struct cdev *cdev, int request, void *buf)
 		ret = mtd->block_markbad(mtd, *offset);
 		break;
 	case MEMERASE:
-		ret = mtd_erase(cdev, ei->length, ei->start + cdev->offset);
+		ret = mtd_op_erase(cdev, ei->length, ei->start + cdev->offset);
 		break;
 #endif
 	case MEMGETINFO:
@@ -170,10 +171,10 @@ int mtd_ioctl(struct cdev *cdev, int request, void *buf)
 }
 
 static struct file_operations mtd_ops = {
-	.read   = mtd_read,
+	.read   = mtd_op_read,
 #ifdef CONFIG_MTD_WRITE
-	.write  = mtd_write,
-	.erase  = mtd_erase,
+	.write  = mtd_op_write,
+	.erase  = mtd_op_erase,
 #endif
 	.ioctl  = mtd_ioctl,
 	.lseek  = dev_lseek_default,
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-02-15  8:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15  8:04 [PATCH] integrate CFI Flash driver into mtd Sascha Hauer
2013-02-15  8:04 ` [PATCH 1/6] libmtd: rename functions from mtd_* to libmtd_* Sascha Hauer
2013-02-15  8:04 ` Sascha Hauer [this message]
2013-02-15  8:04 ` [PATCH 3/6] mtd: Add mtd_* functions Sascha Hauer
2013-02-15  8:04 ` [PATCH 4/6] mtd: Use mtd_* functions where appropriate Sascha Hauer
2013-02-15  8:04 ` [PATCH 5/6] mtd: implement mtd_lock and mtd_unlock Sascha Hauer
2013-02-15  8:04 ` [PATCH 6/6] nor flash: integrate into mtd Sascha Hauer
2013-02-15  8:11 ` [PATCH] " Sascha Hauer
2013-02-15  8:12   ` Sascha Hauer
2013-02-17 10:59     ` Alexander Aring
2013-02-18 10:24       ` Sascha Hauer
2013-02-19 13:23         ` Alexander Aring
2013-02-19 18:45           ` Sascha Hauer

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=1360915499-1659-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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