From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752982AbbEFOa7 (ORCPT ); Wed, 6 May 2015 10:30:59 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:33764 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752702AbbEFOa4 (ORCPT ); Wed, 6 May 2015 10:30:56 -0400 Date: Wed, 6 May 2015 10:30:55 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Lu Baolu cc: Greg Kroah-Hartman , Mathias Nyman , , Subject: Re: [PATCH v2 2/3] usb: xhci: implement device_suspend/device_resume entries In-Reply-To: <1430898002-24748-3-git-send-email-baolu.lu@linux.intel.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 May 2015, Lu Baolu wrote: > This patch implements device_suspend/device_resume entries for xHC driver. > device_suspend will be called when a USB device is about to suspend. It > will issue a stop endpoint command for each endpoint in this device. The > Suspend(SP) bit in the command TRB will set which will give xHC a hint > about the suspend. device_resume will be called when a USB device is just > resumed. It will ring doorbells of all endpoint unconditionally. XHC may > use these suspend/resume hints to optimize its operation. > > Signed-off-by: Lu Baolu ... > #else /* CONFIG_PM */ > > int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, > @@ -4704,6 +4728,16 @@ int xhci_disable_usb3_lpm_timeout(struct usb_hcd *hcd, > { > return 0; > } > + > +void xhci_device_suspend(struct usb_hcd *hcd, > + struct usb_device *udev, pm_message_t msg) > +{ > +} > + > +void xhci_device_resume(struct usb_hcd *hcd, > + struct usb_device *udev, pm_message_t msg) > +{ > +} You don't need to have empty functions. Just do this: #define xhci_device_suspend NULL #define xhci_device_resume NULL in the appropriate place, when CONFIG_PM is not enabled. Alan Stern