From patchwork Mon Jul 17 17:28:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13316090 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED642C001DE for ; Mon, 17 Jul 2023 17:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbjGQR3p (ORCPT ); Mon, 17 Jul 2023 13:29:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbjGQR3b (ORCPT ); Mon, 17 Jul 2023 13:29:31 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA86E55; Mon, 17 Jul 2023 10:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689614949; x=1721150949; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0/SbCMKprSAfQ28hQngw9HD0K6kiWmLO1+VHlEipr8A=; b=NUzdG726O6hieiU68km/gA2xM1nOWjiZFhPs6yoGSdsZcMXF4MHy1yhr XGcszn0BvDqw57/DqPRdv6ObC+O9lodjmW8xKfy8hOAYs2/kg3C6tdDyT IXjWOMUajR4iH6DskqP3iyqLVNmjcYFAVimTugGvh0lI3PpQooKacq/EF tflsz65ZkaZMS20UnS2ghkRDxlY5GWZHcVRZujDLXVnZOUBAdJg4rC2Pl vrpIPGzkBS41BNSpUlBVLRUj3QsSKMqBmgcNPlRRalh0YtdCBLQ9xvoCF cwWDuqCNV/Z2O0lAAWXe/Iwqg41LmLcr0c8rPMJKNzXiUIWg8LEo4snLi w==; X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="355926961" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="355926961" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2023 10:28:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10774"; a="673604209" X-IronPort-AV: E=Sophos;i="6.01,211,1684825200"; d="scan'208";a="673604209" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 17 Jul 2023 10:28:40 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 17FD1604; Mon, 17 Jul 2023 20:28:40 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , Linus Walleij , Balsam CHIHI , Claudiu Beznea , Geert Uytterhoeven , Wolfram Sang , Thierry Reding , Paul Cercueil , 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 , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Jonathan Hunter , "Rafael J. Wysocki" , Len Brown , Pavel Machek Subject: [PATCH v2 05/10] pinctrl: lynxpoint: Make use of pm_ptr() Date: Mon, 17 Jul 2023 20:28:16 +0300 Message-Id: <20230717172821.62827-6-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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Cleaning up the driver to use pm_ptr() and *_PM_OPS() macros that make it simpler and allows the compiler to remove those functions if built without CONFIG_PM and CONFIG_PM_SLEEP support. Signed-off-by: Andy Shevchenko Reviewed-by: Paul Cercueil --- drivers/pinctrl/intel/pinctrl-lynxpoint.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c index cdace55aaeac..50d92bf80e20 100644 --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c @@ -948,9 +948,8 @@ static int lp_gpio_resume(struct device *dev) } static const struct dev_pm_ops lp_gpio_pm_ops = { - .runtime_suspend = lp_gpio_runtime_suspend, - .runtime_resume = lp_gpio_runtime_resume, - .resume = lp_gpio_resume, + SYSTEM_SLEEP_PM_OPS(NULL, lp_gpio_resume) + RUNTIME_PM_OPS(lp_gpio_runtime_suspend, lp_gpio_runtime_resume, NULL) }; static const struct acpi_device_id lynxpoint_gpio_acpi_match[] = { @@ -965,7 +964,7 @@ static struct platform_driver lp_gpio_driver = { .remove = lp_gpio_remove, .driver = { .name = "lp_gpio", - .pm = &lp_gpio_pm_ops, + .pm = pm_ptr(&lp_gpio_pm_ops), .acpi_match_table = lynxpoint_gpio_acpi_match, }, };