summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-14 10:22:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-14 10:22:17 +0100
commitb600cb936ee219aa7c2d9c32371a2fd355c009e5 (patch)
tree94c4e55ab5a914c5436da6d9c011828a507fb05f
parent3930f38028fb8307097ced49ed034ca981b64873 (diff)
downloadbarebox-b600cb936ee219aa7c2d9c32371a2fd355c009e5.tar.gz
barebox-b600cb936ee219aa7c2d9c32371a2fd355c009e5.tar.xz
mtd: rename mtd file operations callback functions
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>
-rw-r--r--drivers/mtd/core.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 070fda652..40c522f94 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,