aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdchar.c
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2010-06-14 12:10:33 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-08-02 04:03:41 -0400
commit9938424f0c4d208883cbf32083ec2bfcc220f85b (patch)
treee4f7581c7543673fe63c98f9804e934a77aeb7ef /drivers/mtd/mtdchar.c
parent1df620637fc3b252b69c92ced486b5b6b643dd1a (diff)
mtd: add an ioctl to query the lock status of a flash sector
This patchs adds a way for user space programs to find out whether a flash sector is locked. An optional driver method in the mtd_info struct provides the information. Signed-off-by: Richard Cochran <richard.cochran@omicron.at> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r--drivers/mtd/mtdchar.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 8b223c0343ee..a8e69dd2b2e4 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -676,6 +676,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
676 break; 676 break;
677 } 677 }
678 678
679 case MEMISLOCKED:
680 {
681 struct erase_info_user einfo;
682
683 if (copy_from_user(&einfo, argp, sizeof(einfo)))
684 return -EFAULT;
685
686 if (!mtd->is_locked)
687 ret = -EOPNOTSUPP;
688 else
689 ret = mtd->is_locked(mtd, einfo.start, einfo.length);
690 break;
691 }
692
679 /* Legacy interface */ 693 /* Legacy interface */
680 case MEMGETOOBSEL: 694 case MEMGETOOBSEL:
681 { 695 {