Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp232023lqp; Thu, 4 Apr 2024 11:26:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYQnCT/PFzHiD5sJziQpY8UXbv5aEi2s8bhDpj7W5cxQ3Ur96URcumQfCmvjzirvgvOt65GeJyRv6rchOjZXHEeqaoVptn0NRnlJ0iCA== X-Google-Smtp-Source: AGHT+IGiN8TYqku4+f3IUnww6V3UJ2MIWE2+lPVEO7Lka72ID7SYZ8JhG0KwNqZlZq04tMU/0phv X-Received: by 2002:ac8:598a:0:b0:434:3e50:54e3 with SMTP id e10-20020ac8598a000000b004343e5054e3mr3351314qte.23.1712255211172; Thu, 04 Apr 2024 11:26:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712255211; cv=pass; d=google.com; s=arc-20160816; b=odzrwk2f+/EfHv7NatUzu1TTfMOS6TW32ozDivgFvyoamXGou6ozIuyA8auo6kaUHJ eAGs8zfbolN0272Jz3FKh80FOgw8QgtsHouUX+fl8BJ2enCQlMvuhbsR6+g/POmqxnxk C6WVlzW90HGKT0HUe0eKXPB3CKM82jgwt+06xYDUZFhPifs1rmcQAAtolCfRkdiLtTtY xiqSMGw8KlAvSyK0hnEalk98LJ5g8pjF6OUox64dDJufbv4fszW3/BHKM2bym/XwU0h9 hnLvYW2QkucHbnoi+F35CgYewZIrdogxWUHMjEKCCFWE/D2MmuYjnKiNApQHX7ClYjFW fxlw== 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=pF2mQqSJvjmelXfcVSuJlzdgYpgsGHIiX5H6ZAqqs64=; fh=UTU1/xo2FO/KWC3uhDxl9NhJ228mqpEO1F8n3ktSp1Y=; b=hytAFkbFvVmbvpmEZi27H/ZmKeLAtyBNzuSswLZhzqouVGGBlyHpDszGnKeXedKt5w DFPGI4kyXA1Ehhcos0fAdkGzAmwtdKyCJ8nSGr/bM0ivBKFy3KIEDxNa0W8bXw3cw8Yx cGRtk1DQeeJJ8XCRE23iSn0XiZMTjPcYSnYLdqyuM/Y1ORENrL90hWF4cRn4XxdXs3qb F6TZFpWFfTp2aWFE8twHEnRnagzKQ2XY+IDe6pm8RV3jbs2VuayHWcANyI7G/VKBuJyG AAdDN1YRcqvCnKWnevNnH6disxOxmXUHxZGd2+CObj8hFYhtiS1biF89tSDIag1l33Rc rhWA==; 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-131954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131954-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 3-20020ac85943000000b00432eb826514si10260491qtz.338.2024.04.04.11.26.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 11:26:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=netrider.rowland.org); spf=pass (google.com: domain of linux-kernel+bounces-131954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131954-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CE9841C228CF for ; Thu, 4 Apr 2024 18:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55F35130ADF; Thu, 4 Apr 2024 18:26:42 +0000 (UTC) Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by smtp.subspace.kernel.org (Postfix) with SMTP id B4F02130A7F for ; Thu, 4 Apr 2024 18:26:38 +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=1712255201; cv=none; b=TGGeKd0Zq0KHTlf0bqtoG0GuoCmtLcsYti9gXu5O+QBeDyqutxvR1HqNwBRmGnXO0jDqIryv4Awz7dPktheDVR2xLMtQ4KgWA/RL7yuVkcFDGCqzlG83HKDLy+0MqMyKAEz5N8KoRE90Y5822oCf69AWwxISbZMOV+HyessPAIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712255201; c=relaxed/simple; bh=jqYMRm7SAbbfCk4uBDe4qlaTk6tIsW2QffwttJ6sznU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=or2G+7Z21dwI52PNDbNmTazMGPTnjX29g7sKK5fn3/cr2cn1pQAnbsEandYcFUfWxzqusXRW7KR/oSBW1/hzO36ggUEnWo4a0du/9UImZraFHZ0c3W/Or+v2zSsgHZR7AOzUt/ZeaJ9SLJHkddEldLQt63aSwr2dzIxshg8Ot+8= 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 15729 invoked by uid 1000); 4 Apr 2024 14:26:32 -0400 Date: Thu, 4 Apr 2024 14:26:32 -0400 From: Alan Stern To: Anand Moon Cc: Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , Christophe JAILLET , Johan Hovold , 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 v2 2/6] usb: ehci-exynos: Switch from CONFIG_PM guards to pm_ptr() Message-ID: <3c3ddbb2-142b-4b3d-a5af-5188f46f0a77@rowland.harvard.edu> References: <20240404071350.4242-1-linux.amoon@gmail.com> <20240404071350.4242-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: <20240404071350.4242-3-linux.amoon@gmail.com> On Thu, Apr 04, 2024 at 12:43:18PM +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. > > Signed-off-by: Anand Moon > --- > v2: add __maybe_unused to suspend/resume functions in case CONFIG_PM is > disabled. > dropped RUNTIME_PM_OPS > --- Acked-by: Alan Stern > drivers/usb/host/ehci-exynos.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c > index f00bfd0b13dc..4cfde1af32be 100644 > --- a/drivers/usb/host/ehci-exynos.c > +++ b/drivers/usb/host/ehci-exynos.c > @@ -236,8 +236,7 @@ static void exynos_ehci_remove(struct platform_device *pdev) > usb_put_hcd(hcd); > } > > -#ifdef CONFIG_PM > -static int exynos_ehci_suspend(struct device *dev) > +static int __maybe_unused exynos_ehci_suspend(struct device *dev) > { > struct usb_hcd *hcd = dev_get_drvdata(dev); > struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); > @@ -256,7 +255,7 @@ static int exynos_ehci_suspend(struct device *dev) > return rc; > } > > -static int exynos_ehci_resume(struct device *dev) > +static int __maybe_unused exynos_ehci_resume(struct device *dev) > { > struct usb_hcd *hcd = dev_get_drvdata(dev); > struct exynos_ehci_hcd *exynos_ehci = to_exynos_ehci(hcd); > @@ -279,10 +278,6 @@ 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 > > static const struct dev_pm_ops exynos_ehci_pm_ops = { > .suspend = exynos_ehci_suspend, > @@ -303,7 +298,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.44.0 >