From patchwork Thu Apr 4 07:13:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 13617339 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 0A381CD1297 for ; Thu, 4 Apr 2024 07:15:15 +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=whsdZnTFJk7YOkF8pgspAZYpaKd1hEdXAyKd9UVGYOk=; b=MmMU8zPQsfMGR4 3le7sOOMgt/FgKA/0A6YuSTbZnLDhLABH9/6CoGTLil7hk+tIlfcxLvbYziUL9JVofZrXJCZZtHKA 7fAG9ZuMYUcePpJGWBk9fyerAVY1P8mQ95YfqyNOmcFf8S2YsY5RJOAWGSyqgywRWAQV3OjTmblrP j5FnlzWilSURbseBmUozmntm3o2tVnslN0wkueB9Wozs9U4ZfVEm7BPOIbUiU9n9L518ssDQ8/IQB 1zzWnmHvHeLAzAsaYl8gaie80CuP3MakHOzszGHnc/2XlUbYQuloTerGGQtd9Z1z/bKNL4x7ENn9U aRBnClfaYoOPpwvQFVfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsHJQ-00000001azE-0Fgq; Thu, 04 Apr 2024 07:15:04 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rsHJN-00000001axo-3Kjs for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2024 07:15:03 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1e0f2798cd8so5831245ad.3 for ; Thu, 04 Apr 2024 00:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712214899; x=1712819699; 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=vZ4F7NXXW550+bos8lcUggXlnE8ksWoIQYNv7Dbni9Q=; b=jdbPlgoc5QXIZivuDecwgaaaEm6ReePZmNOFGobF35iaKzWWvs0YnAnbbweUP3KTQc TOgQZqfnv3GiM2iJDYFi1HSHi3wHuowP2DGQQFRLbXp2UYqLYqm1o1t+TtqJ9gaTUUrr 19LOJqKggWg7kS1kpAY4BTuFlwuRzr8aSlDp8xV9qO3Ltl1+vQQDmBYurTQj448HOPmp ly9bCCGmBEq+DVaNyyG+ECmvcgfgKV9SNRM8H9GXVVAlD2sOZcbgCqKs/ysI+/o9JUIX umQlVU5S/xZhgVY1ty0R4gB0BckhDroNpHOOKdxPNzE2sSLHf5UQ6dYXZ6cj9zRqEUSb V8Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712214899; x=1712819699; 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=vZ4F7NXXW550+bos8lcUggXlnE8ksWoIQYNv7Dbni9Q=; b=D7WnULyPDJXkqZ4aZ22ZJbxJqk5jCFMBGq+O4vwgwPabo/pePZA0qly81alqpl0qck wXqyQriW/U9G38rf82wUtaMB5/BF/Jdg2dofbPozr/zurfTEkkTMjO1ewWPg9UoEnPfc 2k5qlrythfFG18W+pMhbFsR/zff4GbdYCCLaCR4O7UqBHyfQAA60ovI2vnejnjYlvX/n sggb/xUhEA8vnPs9+axDHZh5ibgPlgb1V73QO0ng73CjUPeGsCbJ0IT/11aI4W5hdV3l 6Ly7oIr3CbVuEXOCf3cYjTzeWXc/M35o9sAzVE8h8BmEA7RwXpFpZV1rXF1/rfg3vc3I huXw== X-Forwarded-Encrypted: i=1; AJvYcCUTLK2V0vQkDIa3Y9dGIAonyDdqKXpKfVWFT06TOy6SKEacHEiIFa0X3gr+aC8znZdS3tmfJo6QGNt2OfI2J7ya2zUR+iOw4M/AsHVchPSA4X3+12w= X-Gm-Message-State: AOJu0YxinlnMFPHdEbR1tSnTPqgLfJ6uDUspDrgGR4m1tHzbSzVfUrqt QTLO4N9rvXexOcmstQdjxKqfJmxwOEvAiJCFXqE02QC5QkPhfxVB X-Google-Smtp-Source: AGHT+IF4BglLZMXCnf9J9jEVYynLdLpCHS08eS/S41aNbkggt6yBZJUUl2YbEY/gGHbUJI38+3Orow== X-Received: by 2002:a17:902:ec83:b0:1e2:6240:fe46 with SMTP id x3-20020a170902ec8300b001e26240fe46mr1426005plg.56.1712214899018; Thu, 04 Apr 2024 00:14:59 -0700 (PDT) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id h20-20020a170902f2d400b001e26c4823d0sm5220873plc.52.2024.04.04.00.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 00:14:58 -0700 (PDT) From: Anand Moon To: Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar Cc: Anand Moon , 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: [PATCH v2 2/6] usb: ehci-exynos: Switch from CONFIG_PM guards to pm_ptr() Date: Thu, 4 Apr 2024 12:43:18 +0530 Message-ID: <20240404071350.4242-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404071350.4242-1-linux.amoon@gmail.com> References: <20240404071350.4242-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-20240404_001501_887767_71CE384D X-CRM114-Status: GOOD ( 17.59 ) 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. Signed-off-by: Anand Moon Acked-by: Alan Stern --- v2: add __maybe_unused to suspend/resume functions in case CONFIG_PM is disabled. dropped RUNTIME_PM_OPS --- 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), } };