Commit 73c619ea authored by Joern Engel's avatar Joern Engel

[MTD] Disconnect struct mtd_info from ABI

mtdchar.c direcly copied part of struct mtd_info to userspace, thereby
implicitly making it part of the ABI.  With this patch, struct
mtd_info is independent of the ABI and can have its fields removed,
reordered, etc.
Signed-off-by: default avatarJoern Engel <joern@wh.fh-wedel.de>
parent 92cbfdcc
...@@ -380,6 +380,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, ...@@ -380,6 +380,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int ret = 0; int ret = 0;
u_long size; u_long size;
struct mtd_info_user info;
DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n"); DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n");
...@@ -415,7 +416,15 @@ static int mtd_ioctl(struct inode *inode, struct file *file, ...@@ -415,7 +416,15 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
} }
case MEMGETINFO: case MEMGETINFO:
if (copy_to_user(argp, mtd, sizeof(struct mtd_info_user))) info.type = mtd->type;
info.flags = mtd->flags;
info.size = mtd->size;
info.erasesize = mtd->erasesize;
info.writesize = mtd->writesize;
info.oobsize = mtd->oobsize;
info.ecctype = mtd->ecctype;
info.eccsize = mtd->eccsize;
if (copy_to_user(argp, &info, sizeof(struct mtd_info_user)))
return -EFAULT; return -EFAULT;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment