Commit e659901c authored by spiiroin's avatar spiiroin

[modesetting] Refactor mass-storage mode handling

Code duplication and interleaving of kernel module vs android usb logic
makes it difficult to add support for configfs based systems.

Use helper functions for common tasks.

Use explicit checks for what backend should be used.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 6848228a
This diff is collapsed.
......@@ -41,8 +41,8 @@
void modesetting_verify_values (void);
int modesetting_write_to_file_real(const char *file, int line, const char *func, const char *path, const char *text);
bool modesetting_set_dynamic_mode (void);
void modesetting_unset_dynamic_mode(void);
bool modesetting_enter_dynamic_mode(void);
void modesetting_leave_dynamic_mode(void);
void modesetting_init (void);
void modesetting_quit (void);
......
......@@ -472,7 +472,7 @@ static void usbmoded_switch_to_mode(const char *mode)
log_debug("Cleaning up previous mode");
if( usbmoded_get_usb_mode_data() ) {
modesetting_unset_dynamic_mode();
modesetting_leave_dynamic_mode();
usbmoded_set_usb_mode_data(NULL);
}
......@@ -510,7 +510,7 @@ static void usbmoded_switch_to_mode(const char *mode)
if( !usbmoded_set_usb_module(data->mode_module) )
break;
if( !modesetting_set_dynamic_mode() )
if( !modesetting_enter_dynamic_mode() )
break;
goto SUCCESS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment