The 0day build server caught a new build warning that is triggered when
CONFIG_USB_DEFAULT_PERSIST is turned on:
tree: git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci.git for-usb-next
head:
0730d52a86919300a39a2be37f6c140997dfb82f
commit:
c8476fb855434c733099079063990e5bfa7ecad6 [1/3] usb: xhci: Disable runtime PM suspend for quirky controllers
config: i386-randconfig-r6-0826 (attached as .config)
All warnings:
drivers/usb/host/xhci.c: In function 'xhci_free_dev':
>> drivers/usb/host/xhci.c:3560:17: warning: unused variable 'dev' [-Wunused-variable]
struct device *dev = hcd->self.controller;
^
drivers/usb/host/xhci.c: In function 'xhci_alloc_dev':
>> drivers/usb/host/xhci.c:3648:17: warning: unused variable 'dev' [-Wunused-variable]
struct device *dev = hcd->self.controller;
^
vim +/dev +3560 drivers/usb/host/xhci.c
3554 * disabled. Free any HC data structures associated with that device.
3555 */
3556 void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
3557 {
3558 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
3559 struct xhci_virt_device *virt_dev;
> 3560 struct device *dev = hcd->self.controller;
3561 unsigned long flags;
3562 u32 state;
3563 int i, ret;
3564
3565 #ifndef CONFIG_USB_DEFAULT_PERSIST
3566 /*
3567 * We called pm_runtime_get_noresume when the device was attached.
3568 * Decrement the counter here to allow controller to runtime suspend
3569 * if no devices remain.
3570 */
3571 if (xhci->quirks & XHCI_RESET_ON_RESUME)
3572 pm_runtime_put_noidle(dev);
3573 #endif
3574
...
3641 /*
3642 * Returns 0 if the xHC ran out of device slots, the Enable Slot command
3643 * timed out, or allocating memory failed. Returns 1 on success.
3644 */
3645 int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
3646 {
3647 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
> 3648 struct device *dev = hcd->self.controller;
3649 unsigned long flags;
3650 int timeleft;
3651 int ret;
Fix this.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Shawn Nematbakhsh <shawnn@chromium.org>
{
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
struct xhci_virt_device *virt_dev;
- struct device *dev = hcd->self.controller;
unsigned long flags;
u32 state;
int i, ret;
* if no devices remain.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
- pm_runtime_put_noidle(dev);
+ pm_runtime_put_noidle(hcd->self.controller);
#endif
ret = xhci_check_args(hcd, udev, NULL, 0, true, __func__);
int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev)
{
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
- struct device *dev = hcd->self.controller;
unsigned long flags;
int timeleft;
int ret;
* suspend if there is a device attached.
*/
if (xhci->quirks & XHCI_RESET_ON_RESUME)
- pm_runtime_get_noresume(dev);
+ pm_runtime_get_noresume(hcd->self.controller);
#endif
/* Is this a LS or FS device under a HS hub? */