Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3848429rwb; Sun, 7 Aug 2022 08:37:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR4CNmBHvO6B/DyNE4j8hA9W7/QIWzpu0h18kGzDeW1BcLjLV1vlJkx+shnewEz3mCtifoB/ X-Received: by 2002:a05:6402:5203:b0:43d:444b:9f99 with SMTP id s3-20020a056402520300b0043d444b9f99mr15205114edd.343.1659886671269; Sun, 07 Aug 2022 08:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659886671; cv=none; d=google.com; s=arc-20160816; b=MM89F+eXSzlmj8dnzBi+Py7T3FuaJCu+poS5DwohWQ/9UCp4tpyy1n2AIHsCxgw2+w pAf95ueLnDdTS+IoLXvL/OC8XRnygqfuPBliJCLMBripOp44/pCTMHMTEXc2PRp/6DQ3 zG021fg6mu1D4vNHrCMYDoU5G4cyY85bCN68Ui27kzXzB9LnDjzYb+gVD8xigyu9Kxiy nevVQ6UvJj//K9Wqj91NqHgY69vdMVpP3KADmHg868oK5bDKpFrCpeNULPHZ6pfgjgKq Go1hV24FPUt88NGF/EM+Mb/g6QhlPYqu0MDHRqK1MfECgGRwGj+JG2SoYuXTGkorUZKC JsMQ== 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=43gAJLh+NO1r8Oyt6XxRvPraTLloEC1o3eOKZ6oy6Nw=; b=bysjbKofY8ySlbvioHIA8bQakf1CKi4Qi75jGtLWEYUG6yum6xKLkuwFBgfIEDZyW6 h0J8KoIf1XycMb21iistvRpKtF6wCIF3zlgQTMSXrr8UlFa4V7h1H/6IxRxDayFIAUYj WglV5ZRIpKKLX+pjAIE+Iu9ddXU9AvlnedhbH+UekxPZhOvCZCMhyIVWUzDD5gnV39Cm PFhokEJyFx7brAm76/gWIY820zkLODQymyVx27MuTg6OeJteUacgEo0dCiYEDxZmQFBN iVsJ8quZbvsSwLpMILn93rrgXOoOuuZa7b+XkHQ12j3KkWln3z6XYp8RDA2wTj8vYN0V obKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=B6zlrFb7; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020a170906b29400b007046fc0f0ccsi6771893ejz.320.2022.08.07.08.37.26; Sun, 07 Aug 2022 08:37:51 -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=B6zlrFb7; 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 S234658AbiHGOzq (ORCPT + 99 others); Sun, 7 Aug 2022 10:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234906AbiHGOzP (ORCPT ); Sun, 7 Aug 2022 10:55:15 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F68D9B for ; Sun, 7 Aug 2022 07:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659883986; 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=43gAJLh+NO1r8Oyt6XxRvPraTLloEC1o3eOKZ6oy6Nw=; b=B6zlrFb7+LpdkfI9xxOJzHOPp4YViGVmXNLrD9rJ/0ymSiIj5Ktqo+x3WsbaFV/NPbu+F7 h2jn5hzwWW0QT7/PYPNmVB9TcRSNfYnrcATDi+JmCeyPTvDAi/httHT1jztz+NJByHM4AA 2l0ou23paU4aIaHhNr9m0c/oddll5sQ= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 16/28] mfd: tps6586x: Remove #ifdef guards for PM related functions Date: Sun, 7 Aug 2022 16:52:35 +0200 Message-Id: <20220807145247.46107-17-paul@crapouillou.net> In-Reply-To: <20220807145247.46107-1-paul@crapouillou.net> References: <20220807145247.46107-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, 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: X-Mailing-List: linux-kernel@vger.kernel.org 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. The advantage is then that these functions are now always compiled independently of any Kconfig option, and thanks to that bugs and regressions are easier to catch. Signed-off-by: Paul Cercueil --- 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, -- 2.35.1