From patchwork Fri Mar 1 19:38:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 13579054 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF59CC5475B for ; Fri, 1 Mar 2024 19:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3waBgrAUmHlDVhWEsuDTJWocbpdmaHD2eFdjsLhg4U8=; b=vjTFo4oSuxrTGW +oHwl544ZmMHvWpeBq8bxL+Gf2JYT6uB3avLTb8YuqH+Wu1iBQgsJJnVETixol3BtwH1v/OljVRAc 2ykZoopwsAgxt6rwRua75PNdcoL9OwvSfrqCF0/99C5yreFrqeNJsXhxhun8T57WDWoIR4lHqE598 erh70hYLEf6MvxevhB/6enuhrQ53E/xMgGkatrGWjJVe/JWEenPWQjL+ATGyQLE13iMT4UOf5TSB/ MjyTxJ7Sm10yYD+FNlJ01c5snU1aWOWNiTEbTEwqzZKP9F2T7SUJjPRwwJFpBD4OPhsEFkfBWpyOR hSvl+4i9hZ4FaDrdFQ2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rg8j1-00000001krr-2Xip; Fri, 01 Mar 2024 19:39:19 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rg8iy-00000001kr1-2HEp for linux-arm-kernel@lists.infradead.org; Fri, 01 Mar 2024 19:39:17 +0000 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6e571666829so1602712b3a.3 for ; Fri, 01 Mar 2024 11:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709321955; x=1709926755; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HxDoTNYRXmT98FSYADPnI3hxRtweuOFNAxWJPLtCjpE=; b=mPqj1vSbbXJVckMRmHxahfXk8zCRN67VGtXjsXWdyKgaQj4KMwSWPbBcc7+Y9dPSc0 DRjRhf/Tj3HyZkf1w3RX+MLR7BYMG+M1x816tbEeTv4JmDNLbodgai8hUA2UqNH/PdsH 3IugjD6UT0IptNhUZ/CH8bQW6rwWJdlyYM9lF6t50ISIQyOOsqowdT11j78zDpesW/en QyBFFbvRwT2TPtuZbesld+7Luaa99j3SXsk/ewfXJ7KAZzg6dZdwStM46IF1yMyWfgdf nQXVzx7K+XvubD5VMpsST43gmROJGlBiuWwwHtBfH+mVEq6FZysQLy3vM+8LkR5bAF67 fyrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709321955; x=1709926755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HxDoTNYRXmT98FSYADPnI3hxRtweuOFNAxWJPLtCjpE=; b=bXpeyNevy+h9T8j0Iwjkf89wO0Vi1N/LAiSGEcCXpWruxVCQ3/JKmAmnsVnoJ6Z7uq nZOepwP06klucWkUQRgHWtqKVdtXptb5myMeE1/qmyd8do5srzAhUaDma3xv5CnDUM7z 6UT1RF+/hmgPveuLJBzOlrSB32yIP57TSzk2HnhUxnf7kYe4K+3KjEbvN/HFpfyzoxt8 rMX1hcxrPLwzPM8GykCs0Aw5EoW9IcsqqRqJZCtmchasMcjqv7WVJTMd/UboYFcjr3Q/ mbBL/cfk90P74ACeiySjsjs73AybFIcjET2efMwWTZYJYgfLSI5Q+ZZOzI0ITLdulY3u +b2A== X-Forwarded-Encrypted: i=1; AJvYcCWHBokhl8QxD1i/Zp1VcmqtxHA3r4iNwIfvR6VouwKiYfWF6FhPEyR2xRqsoK9AfG9X4mfA/7h+Iulad9QYpnTPR5inqqlUg3H9tO2EU8LTWclWWPA= X-Gm-Message-State: AOJu0Yypr6ZEOMQE6FRZxpAWPCkaho8EUmvIAuwWbMd+JpU39WolIBXO rt7P6pFYUuRi93bUoK9YDID/qAXBcTCmce4XLHwLJN5psXPO6x7W X-Google-Smtp-Source: AGHT+IHV3s9Cx/ijBF4u/tKBzE9PLqaHiED312E1BkJOfy/2Oat9Li825A6zbvq7V+BUjdFNIg02eg== X-Received: by 2002:a17:902:db0e:b0:1dc:3c3f:c647 with SMTP id m14-20020a170902db0e00b001dc3c3fc647mr3442878plx.26.1709321955473; Fri, 01 Mar 2024 11:39:15 -0800 (PST) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id u8-20020a170902e5c800b001dca6d1d572sm3837474plf.63.2024.03.01.11.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 11:39:15 -0800 (PST) From: Anand Moon To: Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar Cc: Anand Moon , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/4] usb: ehci-exynos: Switch from CONFIG_PM guards to pm_ptr() Date: Sat, 2 Mar 2024 01:08:09 +0530 Message-ID: <20240301193831.3346-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240301193831.3346-1-linux.amoon@gmail.com> References: <20240301193831.3346-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240301_113916_602480_4EB816B3 X-CRM114-Status: GOOD ( 17.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 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), } };