usb: renesas_usbhs: gadget: fix unused-but-set-variable warning
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fri, 28 Jul 2017 10:28:57 +0000 (19:28 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:42:50 +0000 (07:42 -0800)
commit7bbba613477faee424f98e0df95b63b7cbee4cbd
tree7259fd66fd7306ef5ecc3021dfa7a8551cf49036
parent3dd952b45b3b6547b2f029035832e4845fccbbf7
usb: renesas_usbhs: gadget: fix unused-but-set-variable warning

[ Upstream commit b7d44c36a6f6d956e1539e0dd42f98b26e5a4684 ]

The commit b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps
when the driver stops") causes the unused-but-set-variable warning.
But, if the usbhsg_ep_disable() will return non-zero value, udc/core.c
doesn't clear the ep->enabled flag. So, this driver should not return
non-zero value, if the pipe is zero because this means the pipe is
already disabled. Otherwise, the ep->enabled flag is never cleared
when the usbhsg_ep_disable() is called by the renesas_usbhs driver first.

Fixes: b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver stops")
Fixes: 11432050f070 ("usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/renesas_usbhs/mod_gadget.c