usb: dwc3-msm: host_mode is not a boolean
The 'host_mode' member gets set to the value of POWER_SUPPLY_PROP_SCOPE, which is not a boolean. In the case of it being set to POWER_SUPPLY_SCOPE_DEVICE (which has value 2), the code incorrectly assumes the controller is in host mode. Fix the checks for host mode by doing an explicit comparison with POWER_SUPPLY_SCOPE_SYSTEM rather than a non-zero test. Also rename the variable to 'scope' to be extra clear. Change-Id: Id75b8bbc163faecccebdbed20b0689c52aa2b71e CRs-Fixed: 564396 Reported-by:Wesley Cheng <wcheng@codeaurora.org> Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment