diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:00:37 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:15 -0500 |
| commit | d35ea200c0fb5315f16fb2599a4bafd9c1a7b386 (patch) | |
| tree | bca893ecf2cada20a1a3a84f64759c2e75838c5b /include/linux/mtd | |
| parent | 7e1f0dc0551b99acb5e8fa161a7ac401994d57d8 (diff) | |
mtd: introduce mtd_point interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/mtd.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 201bad557047..ca7bfdaf7a6f 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -175,11 +175,8 @@ struct mtd_info { | |||
| 175 | * wrappers instead. | 175 | * wrappers instead. |
| 176 | */ | 176 | */ |
| 177 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); | 177 | int (*erase) (struct mtd_info *mtd, struct erase_info *instr); |
| 178 | |||
| 179 | /* This stuff for eXecute-In-Place */ | ||
| 180 | /* phys is optional and may be set to NULL */ | ||
| 181 | int (*point) (struct mtd_info *mtd, loff_t from, size_t len, | 178 | int (*point) (struct mtd_info *mtd, loff_t from, size_t len, |
| 182 | size_t *retlen, void **virt, resource_size_t *phys); | 179 | size_t *retlen, void **virt, resource_size_t *phys); |
| 183 | 180 | ||
| 184 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ | 181 | /* We probably shouldn't allow XIP if the unpoint isn't a NULL */ |
| 185 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); | 182 | void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len); |
| @@ -283,6 +280,15 @@ static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
| 283 | return mtd->erase(mtd, instr); | 280 | return mtd->erase(mtd, instr); |
| 284 | } | 281 | } |
| 285 | 282 | ||
| 283 | /* | ||
| 284 | * This stuff for eXecute-In-Place. phys is optional and may be set to NULL. | ||
| 285 | */ | ||
| 286 | static inline int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, | ||
| 287 | size_t *retlen, void **virt, resource_size_t *phys) | ||
| 288 | { | ||
| 289 | return mtd->point(mtd, from, len, retlen, virt, phys); | ||
| 290 | } | ||
| 291 | |||
| 286 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 292 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 287 | { | 293 | { |
| 288 | return dev ? dev_get_drvdata(dev) : NULL; | 294 | return dev ? dev_get_drvdata(dev) : NULL; |
