usb: f_cdev: Fix failure in function resume in f_cdev

Currently there is a fault in implementation of function suspend
and resume in f_cdev. In case when function suspend is issued
by the host and then cleared, still cser_resume is not being
performed. This is due to incorrect handling of if else
condition in usb_cser_func_suspend. Fix this by adding
proper handling.

Change-Id: I4f0e4c6c02d4b30f2fe0b67bc39a4fac9dbf96f1
Signed-off-by: Rohith Kollalsi <quic_rkollals@quicinc.com>
This commit is contained in:
Rohith Kollalsi 2022-03-28 23:12:52 +05:30 • committed by Gerrit - the friendly Code Review server
commit 8c4e938dcf

View file

@ -610,11 +610,11 @@ static int usb_cser_func_suspend(struct usb_function *f, u8 options)
if (!port->func_is_suspended) {
usb_cser_suspend(f);
port->func_is_suspended = true;
} else {
if (port->func_is_suspended) {
port->func_is_suspended = false;
usb_cser_resume(f);
}
}
} else {
if (port->func_is_suspended) {
port->func_is_suspended = false;
usb_cser_resume(f);
}
}
return 0;