aboutsummaryrefslogtreecommitdiffstats
path: root/mmcutils
diff options
context:
space:
mode:
authorChristopher Lais <chris+android@zenthought.org>2011-01-16 06:02:34 -0600
committerChristopher Lais <chris+android@zenthought.org>2011-01-16 06:29:31 -0600
commit066a1027a421ee7cdcdc23a7e6fa24e9b256cd1a (patch)
treee007e13f39b9174bcc18fb13653debc8051f5c84 /mmcutils
parenta25cf5ec4fb7348843bdfb623b81019db2d48030 (diff)
downloadbootable_recovery-066a1027a421ee7cdcdc23a7e6fa24e9b256cd1a.zip
bootable_recovery-066a1027a421ee7cdcdc23a7e6fa24e9b256cd1a.tar.gz
bootable_recovery-066a1027a421ee7cdcdc23a7e6fa24e9b256cd1a.tar.bz2
Use raw partition functions for emmc
Change-Id: Ia5d9f18d43228a08f12633d432b299def8e26ae1
Diffstat (limited to 'mmcutils')
-rw-r--r--mmcutils/mmcutils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/mmcutils/mmcutils.c b/mmcutils/mmcutils.c
index 7e283ef..e0efe55 100644
--- a/mmcutils/mmcutils.c
+++ b/mmcutils/mmcutils.c
@@ -278,9 +278,30 @@ mmc_scan_partitions() {
return g_mmc_state.partition_count;
}
+static const MmcPartition *
+mmc_find_partition_by_device_index(const char *device_index)
+{
+ if (g_mmc_state.partitions != NULL) {
+ int i;
+ for (i = 0; i < g_mmc_state.partitions_allocd; i++) {
+ MmcPartition *p = &g_mmc_state.partitions[i];
+ if (p->device_index !=NULL && p->name != NULL) {
+ if (strcmp(p->device_index, device_index) == 0) {
+ return p;
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
const MmcPartition *
mmc_find_partition_by_name(const char *name)
{
+ if (name[0] == '/') {
+ return mmc_find_partition_by_device_index(name);
+ }
+
if (g_mmc_state.partitions != NULL) {
int i;
for (i = 0; i < g_mmc_state.partitions_allocd; i++) {