Loading drivers/mtd/mtdchar.c +10 −8 Original line number Diff line number Diff line Loading @@ -366,19 +366,21 @@ static void mtdchar_erase_callback (struct erase_info *instr) static int otp_select_filemode(struct mtd_file_info *mfi, int mode) { struct mtd_info *mtd = mfi->mtd; size_t retlen; int ret = 0; /* * Make a fake call to mtd_read_fact_prot_reg() to check if OTP * operations are supported. */ if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) return -EOPNOTSUPP; switch (mode) { case MTD_OTP_FACTORY: if (!mtd->read_fact_prot_reg) ret = -EOPNOTSUPP; else mfi->mode = MTD_FILE_MODE_OTP_FACTORY; break; case MTD_OTP_USER: if (!mtd->read_fact_prot_reg) ret = -EOPNOTSUPP; else mfi->mode = MTD_FILE_MODE_OTP_USER; break; default: Loading include/linux/mtd/mtd.h +4 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,8 @@ static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, u_char *buf) { *retlen = 0; if (!mtd->read_fact_prot_reg) return -EOPNOTSUPP; return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf); } Loading @@ -369,6 +371,8 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, u_char *buf) { *retlen = 0; if (!mtd->read_user_prot_reg) return -EOPNOTSUPP; return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); } Loading Loading
drivers/mtd/mtdchar.c +10 −8 Original line number Diff line number Diff line Loading @@ -366,19 +366,21 @@ static void mtdchar_erase_callback (struct erase_info *instr) static int otp_select_filemode(struct mtd_file_info *mfi, int mode) { struct mtd_info *mtd = mfi->mtd; size_t retlen; int ret = 0; /* * Make a fake call to mtd_read_fact_prot_reg() to check if OTP * operations are supported. */ if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) return -EOPNOTSUPP; switch (mode) { case MTD_OTP_FACTORY: if (!mtd->read_fact_prot_reg) ret = -EOPNOTSUPP; else mfi->mode = MTD_FILE_MODE_OTP_FACTORY; break; case MTD_OTP_USER: if (!mtd->read_fact_prot_reg) ret = -EOPNOTSUPP; else mfi->mode = MTD_FILE_MODE_OTP_USER; break; default: Loading
include/linux/mtd/mtd.h +4 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,8 @@ static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, u_char *buf) { *retlen = 0; if (!mtd->read_fact_prot_reg) return -EOPNOTSUPP; return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf); } Loading @@ -369,6 +371,8 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, u_char *buf) { *retlen = 0; if (!mtd->read_user_prot_reg) return -EOPNOTSUPP; return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); } Loading