Message ID | 20221023094852.8035-6-paul@crapouillou.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1565317wrr; Sun, 23 Oct 2022 03:58:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68f6SlP1ypyGMBXYSd+sVhdsRVzTVPXQRVkYLEwTGJ5jI+xrjZFwyyf1sXQXscjHn8a8Fz X-Received: by 2002:a05:6402:42c6:b0:45c:fc58:bd0f with SMTP id i6-20020a05640242c600b0045cfc58bd0fmr26263801edc.19.1666522688498; Sun, 23 Oct 2022 03:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666522688; cv=none; d=google.com; s=arc-20160816; b=o3EiiIkQH+mtqnroLIHruevU+BV0LM9flEwzbXO4iHnyFlE6OlSAfju1LOjSC/ZAuI VHYuPMiGP38byYS6Bcgq3E9TRY3KqRLK2pidAajpe0+pQ/Fat7rKnpoApegfU4+CY3Fz wsLR64Pg4BlCIjXG9Lc4ojzhXaKmGzqDuFZYfKdWPS8vr6+XslhKULX6ue2FE7ghXDXo uZC7HCIuHAbRC1EjFWixSX3XVk99C2wSjcZNoLefynesC1pKZXF2K/Wbbje2hgS6kiUV H15HbkDHeFbwMzlQuFn7XJsi/LMPBp2HLPG6+zaCbkiUjhoywwPHWh+LoDXzgT8NMxZs ljPg== 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=+FBECTcdeQLfSp5bHcYAa/1zAvqLKLLp0tQ+VpGze+A=; b=fahExk5nwp/5Dl0OGYyTr/CP/9+hwxZFlkFcfF622iELMDo4foY90zkWAMSqFDzjBh tGwUfJPQe12+HCnq/ifClHuSAQqVbvPp9FCPWpTOKLs8xZjkS2BTrjhuqJIm00mwlroO KXztPAnS1t5+CZVd2i5oMPB1F9NhO0WJhOwA0yFZkgp7UbrWVejYme4envGd17oPsOV5 yTvxZKnzud2w8IVnIk+r0udnjaWL6F5yCNsnZaGp4JOrcQ8kwdk4azMATX/VOmBIyWxB s6m15HEglpE8AJzzirCXVsAv09dKalGqah5JoMRMHSo62HLPFtdXhv4CrV5rcMdsD5Po pMnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=WMXviK4z; 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=crapouillou.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s16-20020a056402015000b0044f2fb68fe6si21523825edu.495.2022.10.23.03.57.44; Sun, 23 Oct 2022 03:58:08 -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=@crapouillou.net header.s=mail header.b=WMXviK4z; 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=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbiJWJuF (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 05:50:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbiJWJuB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 05:50:01 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB6F2E6BC for <linux-kernel@vger.kernel.org>; Sun, 23 Oct 2022 02:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518546; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+FBECTcdeQLfSp5bHcYAa/1zAvqLKLLp0tQ+VpGze+A=; b=WMXviK4znNH+cxAIFAOQi3B1ykMnVrOcVU4hf2Rqqlk058V80E+qnyk8E0LlkDXjEPWIXm 5qVkv3kePJ7wNXzCipfnq9MYT16MVBahctpgvp0h4oxMOe2Waq01lOVUy6yVlaUaKThAzq zocXklgI+/PciXSlgUahWpIe9bqshyo= From: Paul Cercueil <paul@crapouillou.net> To: Lee Jones <lee@kernel.org> Cc: linux-kernel@vger.kernel.org, Paul Cercueil <paul@crapouillou.net>, Matthias Brugger <matthias.bgg@gmail.com>, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH v3 05/28] mfd: mt6397-irq: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:29 +0100 Message-Id: <20221023094852.8035-6-paul@crapouillou.net> In-Reply-To: <20221023094852.8035-1-paul@crapouillou.net> References: <20221023094852.8035-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747475694305094120?= X-GMAIL-MSGID: =?utf-8?q?1747475694305094120?= |
Series |
mfd: Remove #ifdef guards for PM functions
|
|
Commit Message
Paul Cercueil
Oct. 23, 2022, 9:48 a.m. UTC
Use the new pm_sleep_ptr() macro to handle the .irq_set_wake() callback.
This macro allows the mt6397_irq_set_wake() function to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
drivers/mfd/mt6397-irq.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c index eff53fed8fe7..72f923e47752 100644 --- a/drivers/mfd/mt6397-irq.c +++ b/drivers/mfd/mt6397-irq.c @@ -54,7 +54,6 @@ static void mt6397_irq_enable(struct irq_data *data) mt6397->irq_masks_cur[reg] |= BIT(shift); } -#ifdef CONFIG_PM_SLEEP static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on) { struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(irq_data); @@ -68,9 +67,6 @@ static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on) return 0; } -#else -#define mt6397_irq_set_wake NULL -#endif static struct irq_chip mt6397_irq_chip = { .name = "mt6397-irq", @@ -78,7 +74,7 @@ static struct irq_chip mt6397_irq_chip = { .irq_bus_sync_unlock = mt6397_irq_sync_unlock, .irq_enable = mt6397_irq_enable, .irq_disable = mt6397_irq_disable, - .irq_set_wake = mt6397_irq_set_wake, + .irq_set_wake = pm_sleep_ptr(mt6397_irq_set_wake), }; static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg,