Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329065
b: refs/heads/master
c: 62082e5
h: refs/heads/master
i:
  329063: 310e242
v: v3
  • Loading branch information
Richard Genoud authored and Artem Bityutskiy committed Sep 4, 2012
1 parent 0f611bc commit 286dd4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5dee4674c8dd4398f4806aae153888319c7e2be9
refs/heads/master: 62082e56cbb807cb325a8968f35dbd922432eb48
10 changes: 10 additions & 0 deletions trunk/drivers/mtd/mtdpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,3 +760,13 @@ int mtd_is_partition(const struct mtd_info *mtd)
return ispart;
}
EXPORT_SYMBOL_GPL(mtd_is_partition);

/* Returns the size of the entire flash chip */
uint64_t mtd_get_device_size(const struct mtd_info *mtd)
{
if (!mtd_is_partition(mtd))
return mtd->size;

return PART(mtd)->master->size;
}
EXPORT_SYMBOL_GPL(mtd_get_device_size);
1 change: 1 addition & 0 deletions trunk/include/linux/mtd/partitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ int mtd_is_partition(const struct mtd_info *mtd);
int mtd_add_partition(struct mtd_info *master, char *name,
long long offset, long long length);
int mtd_del_partition(struct mtd_info *master, int partno);
uint64_t mtd_get_device_size(const struct mtd_info *mtd);

#endif

0 comments on commit 286dd4c

Please sign in to comment.