Message ID | 20221023094852.8035-16-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 s2csp1560569wrr; Sun, 23 Oct 2022 03:38:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4d93fGOa09SSUW8UqxFcv49sSxWzqGJef//unN00zvf97yL/5o6LNtnhHVdIYtZ5kmseUe X-Received: by 2002:a17:907:16aa:b0:6fe:91d5:18d2 with SMTP id hc42-20020a17090716aa00b006fe91d518d2mr23593290ejc.190.1666521481669; Sun, 23 Oct 2022 03:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666521481; cv=none; d=google.com; s=arc-20160816; b=dJZ5ep6a0+9LkbHzWw/GSEixGbX6tYdUOsDhozn2yurKjwobeZXnO1f2xbE6bcaDEf QsorAL0JvOFBhYwCROVHMDkrBBnb4JXDCKH3pcr5ptonpkPevk3jEB/+YTWvNhhZ0VMw m7kmIz+rGC+ibO66AUERk4qz+wtm0EgSU+H5B1gJExBnUdP0jXoER7QVv5lej/RauOAC FfekpVehYLmeBlJJDzJjjNs3oYlgFHa+sYGAKlWMHccK2nG6XHSfGu3fCEfTJIuzTx3q HKanhbeuVCZBYPs1D8+7Qk68FWuW+GZ2751BDLXJTpvXIDdsGIN4mpwZgk/M0cQaIDGM HcmQ== 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=C/CZfgeHadcU1fuJomu2DjVRR0sBKfhmzKi2+xTgRd8=; b=GU/aBcD+yiTn2Q9xkZAeQotkifdc+EpJuqxJ0yHcjVwGKQudqGMws1HnqlQ8/cSpIN xLC+P+StFP1uPXQpKVhLQCFgyOwfZls3S787MImxctxi5l48j/WYtvK5owyjEPLIVVqk rEFU5x415dRRUm2TtOut5CLXnrWPeAxhWy+PuMMVtm8T+nFTvrDZEReHwXpy5pVBSEHu cCMtl2TlicFGTR6BuylIfa2RL0E4D70Ir/SSPzM79kDxXeLM+Fk7GKl3G9TRzcs6YRjo A6nxan7tgWSkN4Sis910f7j4izMv58Xq6UzMs8auevHUnfhxn4kcg6PxH6+dk9nf+rPh 5aVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=KWW5ShZK; 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 hz6-20020a1709072ce600b00791a5f0b140si13213449ejc.993.2022.10.23.03.37.37; Sun, 23 Oct 2022 03:38:01 -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=KWW5ShZK; 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 S230036AbiJWJwM (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Sun, 23 Oct 2022 05:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiJWJwJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 23 Oct 2022 05:52:09 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FEAD754B3 for <linux-kernel@vger.kernel.org>; Sun, 23 Oct 2022 02:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518552; 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=C/CZfgeHadcU1fuJomu2DjVRR0sBKfhmzKi2+xTgRd8=; b=KWW5ShZKnp6gjISj0AbHVV6/r/XBPH28JqPe5zr7JiKugFf1U58ilHjvnuLXwg7EzcKOwh Xc66i1gAXijbV0itAU+9WPr3o85M6Gfn9P84Z0p5wgjBGIVMGeDQuFFHL3+z59pcEpyPZ+ F/UweYh07QCMZmKn6adiaKMpvGuCpkA= From: Paul Cercueil <paul@crapouillou.net> To: Lee Jones <lee@kernel.org> Cc: linux-kernel@vger.kernel.org, Paul Cercueil <paul@crapouillou.net> Subject: [PATCH v3 15/28] mfd: tps6586x: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:39 +0100 Message-Id: <20221023094852.8035-16-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?1747474428931894206?= X-GMAIL-MSGID: =?utf-8?q?1747474428931894206?= |
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>
---
drivers/mfd/tps6586x.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index c9303d3d6602..fd57c3974615 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c @@ -269,15 +269,11 @@ static void tps6586x_irq_sync_unlock(struct irq_data *data) mutex_unlock(&tps6586x->irq_lock); } -#ifdef CONFIG_PM_SLEEP static int tps6586x_irq_set_wake(struct irq_data *irq_data, unsigned int on) { struct tps6586x *tps6586x = irq_data_get_irq_chip_data(irq_data); return irq_set_irq_wake(tps6586x->irq, on); } -#else -#define tps6586x_irq_set_wake NULL -#endif static struct irq_chip tps6586x_irq_chip = { .name = "tps6586x", @@ -285,7 +281,7 @@ static struct irq_chip tps6586x_irq_chip = { .irq_bus_sync_unlock = tps6586x_irq_sync_unlock, .irq_disable = tps6586x_irq_disable, .irq_enable = tps6586x_irq_enable, - .irq_set_wake = tps6586x_irq_set_wake, + .irq_set_wake = pm_sleep_ptr(tps6586x_irq_set_wake), }; static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq,