From 3b8bcc53e41b043ddf867766381b0906b3247cb0 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 23 Dec 2011 18:33:28 +0200 Subject: [PATCH] --- yaml --- r: 282875 b: refs/heads/master c: a750b5ce5e1174ea68f66bf79962c479f7f23998 h: refs/heads/master i: 282873: 5376437ecd98ffcfb35a7deec2fae48935190e7e 282871: 4d53d592051b629c69fd0d4e3382eeb1502b47dd v: v3 --- [refs] | 2 +- trunk/drivers/mtd/mtdchar.c | 2 +- trunk/drivers/mtd/mtdpart.c | 2 +- trunk/include/linux/mtd/mtd.h | 19 +++++++++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 3b32a295d168..42967e1d6053 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a2cc5ba075f9bc837d0b4d4ec7328dcefc11859d +refs/heads/master: a750b5ce5e1174ea68f66bf79962c479f7f23998 diff --git a/trunk/drivers/mtd/mtdchar.c b/trunk/drivers/mtd/mtdchar.c index 234e3d27143c..4b1772feeafc 100644 --- a/trunk/drivers/mtd/mtdchar.c +++ b/trunk/drivers/mtd/mtdchar.c @@ -925,7 +925,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) switch (mfi->mode) { case MTD_FILE_MODE_OTP_FACTORY: if (mtd->get_fact_prot_info) - ret = mtd->get_fact_prot_info(mtd, buf, 4096); + ret = mtd_get_fact_prot_info(mtd, buf, 4096); break; case MTD_FILE_MODE_OTP_USER: if (mtd->get_user_prot_info) diff --git a/trunk/drivers/mtd/mtdpart.c b/trunk/drivers/mtd/mtdpart.c index 8a46cd2bb78f..6bed8bb3b15d 100644 --- a/trunk/drivers/mtd/mtdpart.c +++ b/trunk/drivers/mtd/mtdpart.c @@ -175,7 +175,7 @@ static int part_get_fact_prot_info(struct mtd_info *mtd, struct otp_info *buf, size_t len) { struct mtd_part *part = PART(mtd); - return part->master->get_fact_prot_info(part->master, buf, len); + return mtd_get_fact_prot_info(part->master, buf, len); } static int part_write(struct mtd_info *mtd, loff_t to, size_t len, diff --git a/trunk/include/linux/mtd/mtd.h b/trunk/include/linux/mtd/mtd.h index abbc96ad3b2c..9a7a7f2d2296 100644 --- a/trunk/include/linux/mtd/mtd.h +++ b/trunk/include/linux/mtd/mtd.h @@ -192,18 +192,14 @@ struct mtd_info { struct mtd_oob_ops *ops); int (*write_oob) (struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops); + int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, + size_t len); /* Backing device capabilities for this device * - provides mmap capabilities */ struct backing_dev_info *backing_dev_info; - /* - * Methods to access the protection register area, present in some - * flash devices. The user data is one time programmable but the - * factory data is read only. - */ - int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); @@ -330,6 +326,17 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, return mtd->write_oob(mtd, to, ops); } +/* + * Method to access the protection register area, present in some flash + * devices. The user data is one time programmable but the factory data is read + * only. + */ +static inline int mtd_get_fact_prot_info(struct mtd_info *mtd, + struct otp_info *buf, size_t len) +{ + return mtd->get_fact_prot_info(mtd, buf, len); +} + static inline struct mtd_info *dev_to_mtd(struct device *dev) { return dev ? dev_get_drvdata(dev) : NULL;