mtd: introduce mtd_read interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
committed by
David Woodhouse
parent
04c601bfa4
commit
329ad399a9
@@ -182,6 +182,8 @@ struct mtd_info {
|
||||
unsigned long len,
|
||||
unsigned long offset,
|
||||
unsigned long flags);
|
||||
int (*read) (struct mtd_info *mtd, loff_t from, size_t len,
|
||||
size_t *retlen, u_char *buf);
|
||||
|
||||
/* Backing device capabilities for this device
|
||||
* - provides mmap capabilities
|
||||
@@ -189,7 +191,6 @@ struct mtd_info {
|
||||
struct backing_dev_info *backing_dev_info;
|
||||
|
||||
|
||||
int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
|
||||
int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
|
||||
|
||||
/* In blackbox flight recorder like scenarios we want to make successful
|
||||
@@ -301,6 +302,12 @@ static inline unsigned long mtd_get_unmapped_area(struct mtd_info *mtd,
|
||||
return mtd->get_unmapped_area(mtd, len, offset, flags);
|
||||
}
|
||||
|
||||
static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
size_t *retlen, u_char *buf)
|
||||
{
|
||||
return mtd->read(mtd, from, len, retlen, buf);
|
||||
}
|
||||
|
||||
static inline struct mtd_info *dev_to_mtd(struct device *dev)
|
||||
{
|
||||
return dev ? dev_get_drvdata(dev) : NULL;
|
||||
|
Reference in New Issue
Block a user