Message ID | 20230717172821.62827-4-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1274647vqt; Mon, 17 Jul 2023 11:25:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlFd5oU5iZWSIcfuK81NCx3BxkLSrE8+jT9T9gR1b19dpqMcK+kJbyzaWmbUt8QCvJ7Ln9An X-Received: by 2002:a2e:7e06:0:b0:2b6:fa3f:9230 with SMTP id z6-20020a2e7e06000000b002b6fa3f9230mr8326761ljc.46.1689618304870; Mon, 17 Jul 2023 11:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689618304; cv=none; d=google.com; s=arc-20160816; b=S1klcMMuPCJs9pxJi4H1SVrkE5h8G4ZcQODQpvUHYbuj00VSmEZmq5FgyQut3gSHUl gajP+5NEsKdRLRc6K2C1qDqQG+XTDJ/Hduss51lfC/jwhK0o7YrjpCmB+hwWS8GSJ10V aJnHO5Kxga9Hk8gy7rw16+0Ve32+RgJH6vmpkg8732Ny4DdZiyw3atNtjGAGcY9MHqQd 91vNV8SAPMkYMGYbMKk9Da76/khwWw/iYklXFfK8pV4p0wVFmc2yl/vJgqxghoc+WVUn HlZVx833grpXm6ZiFDlueLsjLmQNhP2gbxdczpw4EmBZnJT/oYOIBa1JQgPrC0qyMGqt 06rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OeoEMkr/tMH0YLGfUUfbIxht3O3ZOu5xSaMjhi8LV3Y=; fh=BB0GY8bRtFrF5EQ7S2W7nc4ojj3WvWGP74FS8Jyyj9E=; b=uAtl5MqtsFdR8OjDrbjRjxQRhy9d4ovHR81YT2aRKBzc2gLJvFxYPXUwiDhunRfMWK L8LkV1Nn5Js7e7MJ41Fs6kKboc9OX+3aRrRhu+t+uKLiYODbPM7xvyIAotWUAoACTCvM FYH/M6decqH+VQNhKoScsr9ECVz7CSPpE0wqmXPvPXYx5sWtuSLZbfVsC81aGTMOvRRn vW5XCm3nAorqAgJSxecrWvoF6eMe6fDNFLOvpVBu99atCOkQ15PebMmUvAT/yfoKRbHx XjBEozgxAbDlc/thuZ15eTp6k4tKHNhY/sVkOzAAtA2A/1HPUrt6Ak/Ru0JotrZSEgEk TizQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mphqTspQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec9-20020a170906b6c900b00991f1e4b03dsi14817ejb.406.2023.07.17.11.24.40; Mon, 17 Jul 2023 11:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mphqTspQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbjGQRaC (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Mon, 17 Jul 2023 13:30:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231354AbjGQR3v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 13:29:51 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92544171B; Mon, 17 Jul 2023 10:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689614965; x=1721150965; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G+AngK5QVe4Gm3zAHe5kaHFbmfMaO7Hp6mv7Fr5FR+E=; b=mphqTspQvNZ2Wo9YVLa1ercLgpX7hksdMKjRqe8Yh90GBuMzWVOzRqR5 uDjY6A3eyN7itaWXSlFzfZhKopDgb0CExLE3v55Exo83n5igmGpe2iiGu tAgE5OHvdZbRFLbhNfup/KFLSNWruNldgExaayfgPFFsguL+RhuZs/RA+ yqeGIaNBBvndkMb7o9mbHKyVpnx9GWu7Iv993zftIKHuT8GCzKPNbId09 N2naplm5N1hSbgbNnquIL5evFNlmsvNknytBayxDTTwXmdXHbLmH6zhyL qa6Pxn7iM3D9LO/wcwo6qmw4y4kwzwCoW0pzkUlUiKpeII9qWYbFOkCqW Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="350854507" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="350854507" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 10:28:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="813426657" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="813426657" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jul 2023 10:28:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 023C6516; Mon, 17 Jul 2023 20:28:39 +0300 (EEST) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mika Westerberg <mika.westerberg@linux.intel.com>, Linus Walleij <linus.walleij@linaro.org>, Balsam CHIHI <bchihi@baylibre.com>, Claudiu Beznea <claudiu.beznea@microchip.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Wolfram Sang <wsa+renesas@sang-engineering.com>, Thierry Reding <thierry.reding@gmail.com>, Paul Cercueil <paul@crapouillou.net>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org Cc: Andy Shevchenko <andy@kernel.org>, Sean Wang <sean.wang@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Ludovic Desroches <ludovic.desroches@microchip.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Jonathan Hunter <jonathanh@nvidia.com>, "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz> Subject: [PATCH v2 03/10] pinctrl: cherryview: Switch to use DEFINE_NOIRQ_DEV_PM_OPS() helper Date: Mon, 17 Jul 2023 20:28:14 +0300 Message-Id: <20230717172821.62827-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> References: <20230717172821.62827-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771693203765799309 X-GMAIL-MSGID: 1771693203765799309 |
Series |
pinctrl: Provide NOIRQ PM helper and use it
|
|
Commit Message
Andy Shevchenko
July 17, 2023, 5:28 p.m. UTC
Since pm.h provides a helper for system no-IRQ PM callbacks,
switch the driver to use it instead of open coded variant.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/intel/pinctrl-cherryview.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
Comments
Hi Andy, Le lundi 17 juillet 2023 à 20:28 +0300, Andy Shevchenko a écrit : > Since pm.h provides a helper for system no-IRQ PM callbacks, > switch the driver to use it instead of open coded variant. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/pinctrl/intel/pinctrl-cherryview.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c > b/drivers/pinctrl/intel/pinctrl-cherryview.c > index eee0f9bc3d32..7a2fc9fe175d 100644 > --- a/drivers/pinctrl/intel/pinctrl-cherryview.c > +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c > @@ -1793,7 +1793,6 @@ static int chv_pinctrl_remove(struct > platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM_SLEEP > static int chv_pinctrl_suspend_noirq(struct device *dev) > { > struct intel_pinctrl *pctrl = dev_get_drvdata(dev); > @@ -1877,12 +1876,8 @@ static int chv_pinctrl_resume_noirq(struct > device *dev) > > return 0; > } > -#endif > > -static const struct dev_pm_ops chv_pinctrl_pm_ops = { > - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend_noirq, > - chv_pinctrl_resume_noirq) > -}; > +static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, > chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); That's over 100 characters, please break this line. Cheers, -Paul > > static const struct acpi_device_id chv_pinctrl_acpi_match[] = { > { "INT33FF", (kernel_ulong_t)chv_soc_data }, > @@ -1895,7 +1890,7 @@ static struct platform_driver > chv_pinctrl_driver = { > .remove = chv_pinctrl_remove, > .driver = { > .name = "cherryview-pinctrl", > - .pm = &chv_pinctrl_pm_ops, > + .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops), > .acpi_match_table = chv_pinctrl_acpi_match, > }, > };
On Mon, Jul 17, 2023 at 10:22 PM Paul Cercueil <paul@crapouillou.net> wrote: > Le lundi 17 juillet 2023 à 20:28 +0300, Andy Shevchenko a écrit : ... > > +static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, > > chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); > > That's over 100 characters, please break this line. If it's a problem, I prefer to shorten the names of the callbacks. Would it work for you?
Le lundi 17 juillet 2023 à 22:27 +0300, Andy Shevchenko a écrit : > On Mon, Jul 17, 2023 at 10:22 PM Paul Cercueil <paul@crapouillou.net> > wrote: > > Le lundi 17 juillet 2023 à 20:28 +0300, Andy Shevchenko a écrit : > > ... > > > > +static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, > > > chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); > > > > That's over 100 characters, please break this line. > > If it's a problem, I prefer to shorten the names of the callbacks. > Would it work for you? > That works. -Paul
On Tue, Jul 18, 2023 at 10:54:53AM +0100, Jonathan Cameron wrote: > On Mon, 17 Jul 2023 20:28:14 +0300 > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: ... > Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Thanks! ... > > + static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); > > Very long line and readability not hurt by breaking it. Sure.
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index eee0f9bc3d32..7a2fc9fe175d 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1793,7 +1793,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int chv_pinctrl_suspend_noirq(struct device *dev) { struct intel_pinctrl *pctrl = dev_get_drvdata(dev); @@ -1877,12 +1876,8 @@ static int chv_pinctrl_resume_noirq(struct device *dev) return 0; } -#endif -static const struct dev_pm_ops chv_pinctrl_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(chv_pinctrl_suspend_noirq, - chv_pinctrl_resume_noirq) -}; +static DEFINE_NOIRQ_DEV_PM_OPS(chv_pinctrl_pm_ops, chv_pinctrl_suspend_noirq, chv_pinctrl_resume_noirq); static const struct acpi_device_id chv_pinctrl_acpi_match[] = { { "INT33FF", (kernel_ulong_t)chv_soc_data }, @@ -1895,7 +1890,7 @@ static struct platform_driver chv_pinctrl_driver = { .remove = chv_pinctrl_remove, .driver = { .name = "cherryview-pinctrl", - .pm = &chv_pinctrl_pm_ops, + .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops), .acpi_match_table = chv_pinctrl_acpi_match, }, };