From 162914b355c5e70f9800cb3d6aeaf1079fe8786a Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Fri, 13 Dec 2019 12:22:13 +0530 Subject: [PATCH] usb: composite: Return status zero if remote wakeup is not supported Currently composite driver is calling get_status for the function drivers which supports remote wakeup capability. Instead of this have another judgement to check whether the device is advertising remote wakeup capability. Change-Id: I6e907b2a05ea64e04aa50ee90c4eb53b86b027d4 Signed-off-by: Pratham Pratap --- drivers/usb/gadget/composite.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 866d68593ca0..6169ea071766 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1899,7 +1899,11 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) f = cdev->config->interface[intf]; if (!f) break; - status = f->get_status ? f->get_status(f) : 0; + + if (USB_CONFIG_ATT_WAKEUP & cdev->config->bmAttributes) + status = f->get_status ? f->get_status(f) : 0; + else + status = 0; if (status < 0) break; put_unaligned_le16(status & 0x0000ffff, req->buf);