From nobody Sat Apr 11 21:30:03 2026 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 9EC11C19F2A for ; Sun, 7 Aug 2022 14:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234614AbiHGOzr (ORCPT ); Sun, 7 Aug 2022 10:55:47 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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); } =20 -#ifdef CONFIG_PM_SLEEP static int tps6586x_irq_set_wake(struct irq_data *irq_data, unsigned int o= n) { struct tps6586x *tps6586x =3D irq_data_get_irq_chip_data(irq_data); return irq_set_irq_wake(tps6586x->irq, on); } -#else -#define tps6586x_irq_set_wake NULL -#endif =20 static struct irq_chip tps6586x_irq_chip =3D { .name =3D "tps6586x", @@ -285,7 +281,7 @@ static struct irq_chip tps6586x_irq_chip =3D { .irq_bus_sync_unlock =3D tps6586x_irq_sync_unlock, .irq_disable =3D tps6586x_irq_disable, .irq_enable =3D tps6586x_irq_enable, - .irq_set_wake =3D tps6586x_irq_set_wake, + .irq_set_wake =3D pm_sleep_ptr(tps6586x_irq_set_wake), }; =20 static int tps6586x_irq_map(struct irq_domain *h, unsigned int virq, --=20 2.35.1