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: 777357 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UBzcPdVb" 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-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> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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), } }; From patchwork Fri Mar 1 19:38:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 777356 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 43C4F3C699; Fri, 1 Mar 2024 19:39:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709321971; cv=none; b=qr4NvaRN363syjyKMRlebR8HyPBKtXLjp1OE75r4jVK8jtTexR48nIVkmysotjaby99kZuc0uezytX/N70cpHlSde8w4yJZjFGMW2E5vlQvVpGm5Xol7yjaIymhRwm/k4i0bTYuTIQSgS/9KiM1obrtmeg6PochGatyDz+Bgy+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709321971; c=relaxed/simple; bh=Vi7NWkc1TXRnzVWtxToE3qHIrWqGeB926dS5d87nCDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NQAxsAmgzrImCfbxhcKq7mIgEqGSMbFB3I4XK8nmsK/HnIwEmrV4toOD/tPiVgr0lE0AzdYUxWS1gmFewRlV4HgifCidmPAOf/aAyCzT2lfHZh7BDISXdCdUm9Zxa+WXS6v0q5eMmyZM0CZWcsnVTfIzLEx+K0gQm2hwxnzN5Hk= 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=PB98IRdM; arc=none smtp.client-ip=209.85.210.176 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PB98IRdM" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e56da425b5so1950211b3a.0; Fri, 01 Mar 2024 11:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709321969; x=1709926769; 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=dO4lQ3DX7Qu8zJWJNpEo7HKYrGAn8GSChMZFfiOVl1U=; b=PB98IRdMSadr0X8oqT3VlC4QOcBjKPg/JNJsbPsntoXpHwqAY9yfKh9Dwrp9WVhTgF 3d6/zK01TjKto331Z4U20eavh1DgttsX894/c3cZ2BJYpUqUqG5v3BgUmbQpKhk3ThoV apacQpHEnH2feDFpvuNkJswKcW88o1omzRqRVBhCnHjt4jYZpUyOMfaxy4Gu7Kdl9XPZ TYedtM8IA7Sg+UUJ76ogbVQ2g06r3ew34TfPkU6mUUpUBEcL02I6uLYZA7+eFRrXYIyI ZG2wxS5mdk8Da2VoWqqsn0mtuVAY8PHHaPFY2A2leSphu0EI4TkV0a872N9PN1lM3QzE 5Cvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709321969; x=1709926769; 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=dO4lQ3DX7Qu8zJWJNpEo7HKYrGAn8GSChMZFfiOVl1U=; b=XNS3/lO7guDKcIY88a2S4Umeq//d5q6cI4tnAVwEDn5q2HuZVU0VRvQWU9fV4aPvoY NW9yhKlDkZzIh42Pa3NKpyA519zwFVPdudfgJTnetAn3lpJgtpcQYjUxDZP3KseLh7rv 4FXmA4AcaVq646ZLqiWP5kP8rfOnfIRhEXgJ9igV/unJKM/lnfHNRKsG6TnH0SP7h4hM 1CM/4J5hclu9jKQ9In9qtLieLAYmKMgL+5kFoY7rV3M28owa69B57lQYu6FtufCwqEFh 83Ny/5nufPJBWYHGoOasOoNxA8VFcsVuOLRhPuuUvi3dL5gEnw39d4FcCirbryFwEliD Y6iA== X-Forwarded-Encrypted: i=1; AJvYcCV0Es3jwJPKSlLLgI5NTVHC0A1xcj65pAZwNsxvWYvrC4epj+uuM3E8hzNvBBXSFBEl+XFOg4lZTqBt/+bCtEP89zF9oTfCed2YqPLpNnKOe/WrmEX9wwPFUnZLtdbmclCj4hBcvqX0BmdT3lm8J+aut5Cn78Z605CYhlTXjlz3c1oT8MKQLW15gIU= X-Gm-Message-State: AOJu0Yy2YR8H2CWGscI7rkpPbHNBCp8FVBV54tCXlukk6uL/M3iF53TA DFxFGE5l0YSCbdpQzhNaYq/z594qEndVlZho86jMKY0OMH6PZROw X-Google-Smtp-Source: AGHT+IGde4M3wivnu/XUvD5PTHizKpooiRXEH/Qb75954pFaiKEAN13Gcv1lY/BXZ4UKV5NuULoYhA== X-Received: by 2002:a17:903:41c4:b0:1d9:a2b1:8693 with SMTP id u4-20020a17090341c400b001d9a2b18693mr2982968ple.23.1709321969651; Fri, 01 Mar 2024 11:39:29 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 11:39:29 -0800 (PST) From: Anand Moon To: Thinh Nguyen , 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 4/4] usb: dwc3: exynos: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Date: Sat, 2 Mar 2024 01:08:11 +0530 Message-ID: <20240301193831.3346-5-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-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. If CONFIG_PM_SLEEP unused, they will simply be discarded by the compiler. Signed-off-by: Anand Moon --- drivers/usb/dwc3/dwc3-exynos.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 7c77f3c69825..645a4ec0cd92 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -160,7 +160,6 @@ static const struct of_device_id exynos_dwc3_match[] = { }; MODULE_DEVICE_TABLE(of, exynos_dwc3_match); -#ifdef CONFIG_PM_SLEEP static int dwc3_exynos_suspend(struct device *dev) { struct dwc3_exynos *exynos = dev_get_drvdata(dev); @@ -193,18 +192,13 @@ static const struct dev_pm_ops dwc3_exynos_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(dwc3_exynos_suspend, dwc3_exynos_resume) }; -#define DEV_PM_OPS (&dwc3_exynos_dev_pm_ops) -#else -#define DEV_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ - static struct platform_driver dwc3_exynos_driver = { .probe = dwc3_exynos_probe, .remove_new = dwc3_exynos_remove, .driver = { .name = "exynos-dwc3", .of_match_table = exynos_dwc3_match, - .pm = DEV_PM_OPS, + .pm = pm_sleep_ptr(&dwc3_exynos_dev_pm_ops), }, };