diff options
author | Joern Engel <joern@wh.fh-wedel.de> | 2006-05-30 08:25:35 -0400 |
---|---|---|
committer | Joern Engel <joern@wh.fh-wedel.de> | 2006-05-30 08:25:35 -0400 |
commit | 73c619ea0e49c9306afa7ea53c3362fbc56ffd70 (patch) | |
tree | d71189bae015f56bf72e7421d4cf1a307b3c1fb8 /drivers/mtd | |
parent | 92cbfdcc3661d7670b01b92b89811cd3a2412297 (diff) |
[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: Joern Engel <joern@wh.fh-wedel.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdchar.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index fdc535b22e39..5dd0b8d72c8b 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -380,6 +380,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
380 | void __user *argp = (void __user *)arg; | 380 | void __user *argp = (void __user *)arg; |
381 | int ret = 0; | 381 | int ret = 0; |
382 | u_long size; | 382 | u_long size; |
383 | struct mtd_info_user info; | ||
383 | 384 | ||
384 | DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n"); | 385 | DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n"); |
385 | 386 | ||
@@ -415,7 +416,15 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
415 | } | 416 | } |
416 | 417 | ||
417 | case MEMGETINFO: | 418 | case MEMGETINFO: |
418 | if (copy_to_user(argp, mtd, sizeof(struct mtd_info_user))) | 419 | info.type = mtd->type; |
420 | info.flags = mtd->flags; | ||
421 | info.size = mtd->size; | ||
422 | info.erasesize = mtd->erasesize; | ||
423 | info.writesize = mtd->writesize; | ||
424 | info.oobsize = mtd->oobsize; | ||
425 | info.ecctype = mtd->ecctype; | ||
426 | info.eccsize = mtd->eccsize; | ||
427 | if (copy_to_user(argp, &info, sizeof(struct mtd_info_user))) | ||
419 | return -EFAULT; | 428 | return -EFAULT; |
420 | break; | 429 | break; |
421 | 430 | ||