Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp526400lqg; Fri, 1 Mar 2024 12:19:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwusMdXcNPglzr/J2+sdmSVx1/1CknTrrOJcYdFvSDVweGY4hT/uWhh9vAC2/WVkYGzoSFZ4QysU8yrlDYIwIKhlI8wU5Ny3mQWfpawA== X-Google-Smtp-Source: AGHT+IEajr08auo/jsRoCOY+PQRWIypeImSs01Mk9/Hrp7eJ17g64fXSMef0Ca3KK1lwYk1kfwTr X-Received: by 2002:a05:6808:13c7:b0:3c1:92ee:cb37 with SMTP id d7-20020a05680813c700b003c192eecb37mr3262601oiw.3.1709324370739; Fri, 01 Mar 2024 12:19:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709324370; cv=pass; d=google.com; s=arc-20160816; b=elFtU5xRQjuAAsl38R6IVt2Nn554h3uZLoaGw4Ps2aMlgkxLha4sLZe/SxxODgVB+b vEhZmYH4naFl5D5/wcsT1e6s6isCcs7/Ckw9MOtFz4A28HXHye/6nv4bAiCvx7a8BQg5 zLC1IwsrrFioSCCWAQMh9HfwbrZL6mBBPp1URXpmMBIztyPdCpj93tCUEJq3uH/3YRyk vzjQeFI6wGuPx8fuYHyKQnUb7s11wQx42r4YnUAwP/AfEwxcMEJtUyxtULFB7XUxV4M0 JAkyEbRZNDCOGsdAb+28+5pu6RrXP57OJfg7gUdxkLfddtSQ2YoA4Qlp+yURBsg9zlp0 XeEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HxDoTNYRXmT98FSYADPnI3hxRtweuOFNAxWJPLtCjpE=; fh=6Gxw7DwMA0xkY/yHHXNRkQ3aL8uEq0q++dhJVUEz/ZI=; b=bDO71M7aVFtApvT4o450fkFZ3iD7t2BGkf0UkFspaLriokMPmYcWcpQbudUJSPlfkx P+7Pzw64GppBD3fKL0OlSPhCsN/MolaxPKjNleVk3ez79FV6gOS7qFPL0/+9KWssC3kZ jx97goo1ji7GucbEE9z6T7er5Z/r7JDGCQ4/YXRu/ROWx6yVZPALmssFuzFF4SAj1T5W 1PtcwzOrt2f4TyjJaRssuro75ldPa1+kwlEqxN4vOYWtj21Yl31L8aZiukKhB/Qgpr6/ NaS6UlVnvOlf2AY6fd3//esIuGQeoLPQWM7Ek/rSPItY89IVqtTGsEKZBB0pDlWVcXEu UDLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UBzcPdVb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-89035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z13-20020a630a4d000000b005dbdc9098c6si3527263pgk.445.2024.03.01.12.19.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:19:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UBzcPdVb; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-89035-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 90C14B26493 for ; Fri, 1 Mar 2024 19:39:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 790ED3BB53; Fri, 1 Mar 2024 19:39:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UBzcPdVb" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4192A3BB4C; Fri, 1 Mar 2024 19:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709321957; cv=none; b=u4kufTBVLX5AqD+Rni4eWf3qV0Nt8Ls2DQzb9JK1rXDP0u/6e7jjNPets4emhJoZZ6977a+kyrExWyT3naLJenQrfDxkRmqIVKGavxnuGWGIGdzAM4qbSKMfQtag/VQncUshIwCDIAV/+g7Sj9GGOuJRhi3XKRRsMoFe7XVvbmw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709321957; c=relaxed/simple; bh=gqPz4yvQ+t5mgEesD3379Ygl8s3Sjp/9uomF+8Ie42A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FKkJ5yGG31wKeyX3y76vO8SXRSfobMY51odmCjMad3ZwpSJXK7Nhqmhb5zn5wz87VW9t85PSsEu9CLTkO0E9TvZzpwOfeE/5lwkzZr40dZ7eTvqfowtUml/bDiN9wFj1hiryuEMBLBG2CzG/aqnoKjVSephJs+Op/mWUuo/C/qU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UBzcPdVb; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1dc1e7c0e29so9213395ad.1; Fri, 01 Mar 2024 11:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709321955; x=1709926755; darn=vger.kernel.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=UBzcPdVbwnODYw813IfKrAWRAZXBREFHBdh6wB/uFrr2vTo2ZpmdbKyrrPZIdVL7Ce z2pHe96VCcxSjImNPlxvIYAXZ9lrs1mu7MEZXN62iNesAKDwBk2offuMlMXmNbYoaHEK gGt8fi1Z3PLnyY7BSxDoduOwg+70XpAT26rCchlujRtL7cXZ1FOX9nalewaOp30Dwc28 DyMuRuCq40P4q4MRNsQJgkrGprLX2z+Ps3yZZMb34Mqfsee0Jn7eaDGwy/9tVdYYSeN5 DTv62T2eZxhhqn/5c1tuMnxjCkRTT7r0eoULTYGTjWSsHHZrhqgqe6ub4K9iBlpOtxS2 y34Q== 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=rMI+nG4siRakA4X783JLT7j473G1mEUwmKFD1cow5CNB+qc2tY9t7d1mEXTEI7ZFWK /Lz4KTTtAJLf8+VCaSrwGyqE5FWX+OiSqinFEU4Z/83KXPy8Q1wzx3COKpQMKSL3Gx1I ZGD1M2tGrQhIqTqUZNHCUSM2Mgb4Ve6u6B5BjP4INLsG2TPyeB6wcU/zHXktxMISIu/B srw0wKGIUzQUV/z9K3X5kYDLodkvqWiqyGLJrgrwaJgAdKe+QHN6iKj+wu9W2iqLqqyQ WtAbisomYQHufI5LDH0Cs3ZxflK396WZLxzvHhrIe8XulkPUvvExsEBdRNUwROn70Uyd DKbA== X-Forwarded-Encrypted: i=1; AJvYcCV/Mj9R69w6laZC9q031o8rnGmTL9InD6lAELpR+pl/f4B0SuAuFz2AW5MJES7u1QWSwUJWTzVhZWqkZo8MEt8x1DBePSvtQkbTLSV0emd9wY3IdMaG+zyIwoT3qJABdTzz2HzGJqDbW6XugyMlQtvzGP8Amlna+hjsEz3X1A6vpXXiIzWIFBwk9QM= X-Gm-Message-State: AOJu0Yw7qHU1Ff/7Gc9tNR5TYKfyMw5H/xgHTkRw4vr5JIYdMhugtb6n iJH4rAecapBD8JF/OLPZLGoNl6Msh+W6F9pnBa/ibuPZrvpto/1a9xLdtS29 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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), } }; -- 2.43.0