Lines Matching refs:mfi
57 struct mtd_file_info *mfi = file->private_data; in mtdchar_lseek() local
58 return fixed_size_llseek(file, offset, orig, mfi->mtd->size); in mtdchar_lseek()
67 struct mtd_file_info *mfi; in mtdchar_open() local
94 mfi = kzalloc(sizeof(*mfi), GFP_KERNEL); in mtdchar_open()
95 if (!mfi) { in mtdchar_open()
99 mfi->mtd = mtd; in mtdchar_open()
100 file->private_data = mfi; in mtdchar_open()
115 struct mtd_file_info *mfi = file->private_data; in mtdchar_close() local
116 struct mtd_info *mtd = mfi->mtd; in mtdchar_close()
126 kfree(mfi); in mtdchar_close()
152 struct mtd_file_info *mfi = file->private_data; in mtdchar_read() local
153 struct mtd_info *mtd = mfi->mtd; in mtdchar_read()
180 switch (mfi->mode) { in mtdchar_read()
242 struct mtd_file_info *mfi = file->private_data; in mtdchar_write() local
243 struct mtd_info *mtd = mfi->mtd; in mtdchar_write()
274 switch (mfi->mode) { in mtdchar_write()
332 static int otp_select_filemode(struct mtd_file_info *mfi, int mode) in otp_select_filemode() argument
334 struct mtd_info *mtd = mfi->mtd; in otp_select_filemode()
343 mfi->mode = MTD_FILE_MODE_OTP_FACTORY; in otp_select_filemode()
350 mfi->mode = MTD_FILE_MODE_OTP_USER; in otp_select_filemode()
353 mfi->mode = MTD_FILE_MODE_NORMAL; in otp_select_filemode()
366 struct mtd_file_info *mfi = file->private_data; in mtdchar_writeoob() local
383 ops.mode = (mfi->mode == MTD_FILE_MODE_RAW) ? MTD_OPS_RAW : in mtdchar_writeoob()
410 struct mtd_file_info *mfi = file->private_data; in mtdchar_readoob() local
420 ops.mode = (mfi->mode == MTD_FILE_MODE_RAW) ? MTD_OPS_RAW : in mtdchar_readoob()
650 struct mtd_file_info *mfi = file->private_data; in mtdchar_ioctl() local
651 struct mtd_info *mtd = mfi->mtd; in mtdchar_ioctl()
879 mfi->mode = MTD_FILE_MODE_NORMAL; in mtdchar_ioctl()
881 ret = otp_select_filemode(mfi, mode); in mtdchar_ioctl()
894 switch (mfi->mode) { in mtdchar_ioctl()
922 if (mfi->mode != MTD_FILE_MODE_OTP_USER) in mtdchar_ioctl()
960 mfi->mode = 0; in mtdchar_ioctl()
965 ret = otp_select_filemode(mfi, arg); in mtdchar_ioctl()
971 mfi->mode = arg; in mtdchar_ioctl()
1033 struct mtd_file_info *mfi = file->private_data; in mtdchar_compat_ioctl() local
1034 struct mtd_info *mtd = mfi->mtd; in mtdchar_compat_ioctl()
1115 struct mtd_file_info *mfi = file->private_data; in mtdchar_get_unmapped_area() local
1116 struct mtd_info *mtd = mfi->mtd; in mtdchar_get_unmapped_area()
1136 struct mtd_file_info *mfi = file->private_data; in mtdchar_mmap_capabilities() local
1138 return mtd_mmap_capabilities(mfi->mtd); in mtdchar_mmap_capabilities()
1148 struct mtd_file_info *mfi = file->private_data; in mtdchar_mmap() local
1149 struct mtd_info *mtd = mfi->mtd; in mtdchar_mmap()