From patchwork Wed Aug 7 01:35:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 2839731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C55A39F479 for ; Wed, 7 Aug 2013 01:35:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5BD6201B3 for ; Wed, 7 Aug 2013 01:35:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 136372018B for ; Wed, 7 Aug 2013 01:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756757Ab3HGBfy (ORCPT ); Tue, 6 Aug 2013 21:35:54 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:51302 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756711Ab3HGBfx (ORCPT ); Tue, 6 Aug 2013 21:35:53 -0400 Received: by mail-vb0-f46.google.com with SMTP id p13so1253479vbe.33 for ; Tue, 06 Aug 2013 18:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FenWcvEUAF/GHzTm2MRmxAIanFQFa5ppLIsWiyJspMY=; b=z+CuSoxN7XuwKcEyHAmmuVjyTH+NEYwMyGL6KuK41mRPapTcO8hG6e5jUhGrlhff5N 09ik3JbhUy3GZH+TbW581GvxITU9tHyM8xvqwsDu8HSjURWkC//Ww//douf4o8gSeRFw UG9C4QQjGn5MPRGb7Fc4BRUWXOVkAmyzjHoRXIfwoutf4q6PVPxIpDa8vXyRVGZK0apN b2XARdE35QrTBHPyPcE7G/LwCiqgX3WuuSqFIaTaef7saMnmUu6BGiO0xa1x9YAC5RjA gft75xc6YJ+nVaw+41O3qG22lFeYIco0Xo61320c+jIVb0vdw2lAGXCXxeHe1peUN8KO lGYg== MIME-Version: 1.0 X-Received: by 10.52.96.195 with SMTP id du3mr227353vdb.71.1375839352444; Tue, 06 Aug 2013 18:35:52 -0700 (PDT) Received: by 10.58.237.66 with HTTP; Tue, 6 Aug 2013 18:35:52 -0700 (PDT) In-Reply-To: <1375804166-3205-1-git-send-email-broonie@kernel.org> References: <1375804166-3205-1-git-send-email-broonie@kernel.org> Date: Tue, 6 Aug 2013 22:35:52 -0300 Message-ID: Subject: Re: [PATCH] usb: dwc3-pci: Ensure system sleep PM ops are defined only when used From: Fabio Estevam To: Mark Brown Cc: Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-omap@vger.kernel.org, Andy Green , Mark Brown Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Mark, On Tue, Aug 6, 2013 at 12:49 PM, Mark Brown wrote: > From: Andy Green > > You might have CONFIG_PM, but you might not have CONFIG_SUSPEND, in which > case these are unused. > > Signed-off-by: Andy Green > Signed-off-by: Mark Brown What about doing this instead? the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -191,7 +191,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = { }; MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table); -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int dwc3_pci_suspend(struct device *dev) { struct pci_dev *pci = to_pci_dev(dev); @@ -216,15 +216,10 @@ static int dwc3_pci_resume(struct device *dev) return 0; } +#endif /* CONFIG_PM_SLEEP */ -static const struct dev_pm_ops dwc3_pci_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(dwc3_pci_suspend, dwc3_pci_resume) -}; - -#define DEV_PM_OPS (&dwc3_pci_dev_pm_ops) -#else -#define DEV_PM_OPS NULL -#endif /* CONFIG_PM */ +static SIMPLE_DEV_PM_OPS(dwc3_pci_dev_pm_ops, dwc3_pci_suspend, + dwc3_pci_resume); static struct pci_driver dwc3_pci_driver = { .name = "dwc3-pci", @@ -232,7 +227,7 @@ static struct pci_driver dwc3_pci_driver = { .probe = dwc3_pci_probe, .remove = dwc3_pci_remove, .driver = { - .pm = DEV_PM_OPS, + .pm = &dwc3_pci_dev_pm_ops, }, }; -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in