Commit c7fe1a26 authored by spiiroin's avatar spiiroin

[modesetting] Do not use "none" as usb function

Use of "none" string as no-usb-function place holder causes journal spamming
as kernels are likely to return EINVAL error when it is actually used.

Substitute "none" with empty string when written to usb function control
file.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 29ac4085
......@@ -116,6 +116,16 @@ int write_to_file(const char *path, const char *text)
if(!text || !path)
return err;
/* There is usb-moded code and configuration files that use
* "none" as a place-holder for no-function. Attempting to
* write that into sysfs leads to journal spamming due to
* EINVAL error return. Substituting "none" with an empty
* string avoids that. */
if( !strcmp(path, "/sys/class/android_usb/android0/functions") &&
!strcmp(text, "none") ) {
text = "";
}
#if LOG_ENABLE_DEBUG
if(log_level >= LOG_DEBUG)
{
......
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