Skip to content

Commit

Permalink
Fix issue with empty mode list, add extra debug info
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Jun 6, 2013
1 parent 23a63a7 commit a0e16ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/usb_moded-modesetting.c
Expand Up @@ -315,6 +315,10 @@ void unset_dynamic_mode(void)
struct mode_list_elem *data;

data = get_usb_mode_data();
/* the modelist could be empty */
if(!data)
return;

if(data->sysfs_path)
{
write_to_file(data->sysfs_path, data->sysfs_reset_value);
Expand Down
2 changes: 2 additions & 0 deletions src/usb_moded-modules.c
Expand Up @@ -133,6 +133,8 @@ int usb_moded_load_module(const char *module)
}
if( ret == 0)
log_info("Module %s loaded successfully\n", module);
else
log_info("Module %s failed to load\n", module);
return(ret);
}

Expand Down
1 change: 1 addition & 0 deletions src/usb_moded.c
Expand Up @@ -511,6 +511,7 @@ static gboolean charging_fallback(gpointer data)
*/
free(current_mode.mode);
current_mode.mode = strdup(MODE_ASK);
current_mode.data = NULL;
charging_timeout = 0;
log_info("Falling back on charging mode.\n");

Expand Down

0 comments on commit a0e16ef

Please sign in to comment.