Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp530718lqg; Fri, 1 Mar 2024 12:28:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUj+cLrfcxadnkmB+elYzvJeFLT8Pl3qlLRz70qOJ+dmlokCoObn78KadAs1ycBuwyg7fyJb8w7Q6dW5y4jO28ywKbi5ESUnGZ22K2ntg== X-Google-Smtp-Source: AGHT+IF2nVzgkS/6qOFPXA0VpBZDWXfhW6T5DgdXlITwBcLme2sG7y9+zM6eKAwT/uXk6oZjsZGW X-Received: by 2002:a17:906:6d06:b0:a3f:86ca:ed2f with SMTP id m6-20020a1709066d0600b00a3f86caed2fmr2102235ejr.49.1709324934725; Fri, 01 Mar 2024 12:28:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709324934; cv=pass; d=google.com; s=arc-20160816; b=T3k7K+b0EgNs3P6Q0LJt9c3l45Tu03BP0OitRxvu4Sp99k8UNHmzFMgilbFKzhNM88 Btv5VDjSN+vu8Y/qiM165u51NJZahe1oBliaQxKn0y/jpriJHbEOPim53fCTAfFapdbd vjIqSjLLcfOJN4d8ywsRYmIOUb6z4zM78eI7ebvMdG1Jn3Vf+3BRNQWBdBGp8gtnl3zR uVe5w0CVwlmWyjdyCLfsPyL0rD5QLzZ8/Bk8rN2P2e0ZeT7L/6GE4X8aDCUZ6/FA1w7S 6u+4YM7cJ9oxSVlPM+NzYQQLYB82U/cEl0z+sROSgMiXdxaMF4U+IBpY/1xneNzeZW8G 1mZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=MvSeCJJ9vqf0f3EqtIBIKxKEULCa6DylLkyk4vTPz/w=; fh=Hp6gfLLaHYxx9QryLynraQzgnPtI/zJBdxd2pbVUth8=; b=VwWAtETSNDo8krL2XMB7c09oyx6e3JfwozHUAMvZMRlEecRWfi8r088bRc8XSqCYCB uKAJPuWMmmgU5ZMD37iR4GZ5ot+gaRHnnGEroiQf9/JaGafAwCaDcI4594KvD6FJNRvT HOsiy7lj9Nczy9in2o4eqvsoHz06/B+WR6NouKxKZU+jJnVqX54h4AW+HZC2FhdSWU7R njMHSNGcrdAmtpGX2cD2G9JqeUYceHiBokyTZqRmf3XnpLXsc6WOKmngcw5+zXkk7cI5 LD02L834nXiq3FTVvXbK3VX0l39QjMbl8DO3kURMzEUpQpsZ+78z0IcpvCULjS5G57pb wr/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-89088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id se16-20020a170906ce5000b00a3e50678318si1683820ejb.238.2024.03.01.12.28.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:28:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-89088-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89088-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6E67D1F2544B for ; Fri, 1 Mar 2024 20:28:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9B8B3D0C6; Fri, 1 Mar 2024 20:28:22 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id 8D2B23D0A8 for ; Fri, 1 Mar 2024 20:28:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.131.102.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709324902; cv=none; b=DscpGvBZnBVE1XHJNBpIADwhDaJdLhWMy7x1tz9bVXeVY2bGEdUvh0mW13j9/vff1wZoII6e3e78t8HkRox1bOjZoyGJPDAX+eJ45IP0ls7ek0hdpTRiOCkORX39VepW+9sWMJGkr2PeEK0y/Fh9Gguppsu6RyxHcllte9i1LSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709324902; c=relaxed/simple; bh=EBfTrXbaVw8O69nDsibgHGIoJmqZhM54EJbwk5vcvOE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b20zzsnBJAE9b9JXEM03Mf6VvWAOLJOnCNKUhpAPzbg/2HxXRIPyejA8Y+BZjG06GgCtL2pxAgpr/ow4+efa2xckEpFJksXfh6/bGNnXU3eqHvyW9FXVKOYeAd0/tbZ0SStMdbaiYkqcL7KISCkcaPKXwQr6op9FS6aO6WODF3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu; spf=pass smtp.mailfrom=netrider.rowland.org; arc=none smtp.client-ip=192.131.102.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netrider.rowland.org Received: (qmail 45460 invoked by uid 1000); 1 Mar 2024 15:28:19 -0500 Date: Fri, 1 Mar 2024 15:28:19 -0500 From: Alan Stern To: Anand Moon Cc: Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/4] usb: ehci-exynos: Switch from CONFIG_PM guards to pm_ptr() Message-ID: References: <20240301193831.3346-1-linux.amoon@gmail.com> <20240301193831.3346-3-linux.amoon@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240301193831.3346-3-linux.amoon@gmail.com> On Sat, Mar 02, 2024 at 01:08:09AM +0530, Anand Moon wrote: > Use the new PM macros for the suspend and resume functions to be > automatically dropped by the compiler when CONFIG_PM are disabled, > without having to use #ifdef guards. If CONFIG_PM unused, > they will simply be discarded by the compiler. > > Use RUNTIME_PM_OPS runtime macro for suspend/resume function. > > Signed-off-by: Anand Moon > --- > drivers/usb/host/ehci-exynos.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c > index 05aa3d9c2a3b..4676f45655cd 100644 > --- a/drivers/usb/host/ehci-exynos.c > +++ b/drivers/usb/host/ehci-exynos.c > @@ -234,7 +234,6 @@ static void exynos_ehci_remove(struct platform_device *pdev) > usb_put_hcd(hcd); > } > > -#ifdef CONFIG_PM > static int exynos_ehci_suspend(struct device *dev) > { > struct usb_hcd *hcd = dev_get_drvdata(dev); > @@ -268,14 +267,9 @@ static int exynos_ehci_resume(struct device *dev) > ehci_resume(hcd, false); > return 0; > } > -#else > -#define exynos_ehci_suspend NULL > -#define exynos_ehci_resume NULL > -#endif Doesn't this now generate warnings about functions being defined but not used when you build with CONFIG_PM disabled? Alan Stern > > static const struct dev_pm_ops exynos_ehci_pm_ops = { > - .suspend = exynos_ehci_suspend, > - .resume = exynos_ehci_resume, > + RUNTIME_PM_OPS(exynos_ehci_suspend, exynos_ehci_resume, NULL) > }; > > #ifdef CONFIG_OF > @@ -292,7 +286,7 @@ static struct platform_driver exynos_ehci_driver = { > .shutdown = usb_hcd_platform_shutdown, > .driver = { > .name = "exynos-ehci", > - .pm = &exynos_ehci_pm_ops, > + .pm = pm_ptr(&exynos_ehci_pm_ops), > .of_match_table = of_match_ptr(exynos_ehci_match), > } > }; > -- > 2.43.0 >