From 193753aa1f93ba28995a80048cbc46f1fc5cde05 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 20 Nov 2013 16:39:42 +0000 Subject: Introduce volume_{present,removable} and fix invalid calls in apps/ The code was trying to probe for volume presence by calling drive layer with volume index. It is a miracle it get unnoticed so far. Introduce proper volume probing using the vol->drive map in the disk layer. Change-Id: I463a5bcc8170f007cad049536094207d2ba3c6fc Reviewed-on: http://gerrit.rockbox.org/669 Reviewed-by: Amaury Pouly --- apps/root_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/root_menu.c b/apps/root_menu.c index 1ffde91eb7..71844dd41a 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -71,6 +71,7 @@ #endif #include "language.h" #include "plugin.h" +#include "disk.h" struct root_items { int (*function)(void* param); @@ -131,12 +132,12 @@ static int browser(void* param) for (i = 0; i < NUM_VOLUMES; i++) { char vol_string[VOL_ENUM_POS + 8]; - if (!storage_removable(i)) + if (!volume_removable(i)) continue; /* VOL_NAMES contains a %d */ snprintf(vol_string, sizeof(vol_string), "/"VOL_NAMES, i); /* test whether we would browse the external card */ - if (!storage_present(i) && + if (!volume_present(i) && (strstr(last_folder, vol_string) #ifdef HAVE_HOTSWAP_STORAGE_AS_MAIN || (i == 0) -- cgit v1.2.3