From nobody Sat Apr 11 21:30:04 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 A2561C19F2A for ; Sun, 7 Aug 2022 14:53:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234322AbiHGOx4 (ORCPT ); Sun, 7 Aug 2022 10:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234397AbiHGOxt (ORCPT ); Sun, 7 Aug 2022 10:53:49 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07263A44A for ; Sun, 7 Aug 2022 07:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659883982; 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=31kG5gjhviHwLsXux6Sn6owRjNJeuuOaVC6064XnvhM=; b=4RybMQjmOajH4LdLvd0aKYxNZvWQsWxpaRt1gNatYx4FW2YUt05DgcNXYmvIlHZhmkE7fd 7HTCIOyEYtrHUbzxj352yIJ0tHmPkCZOabH8bbSQo5Wsbn+Ll12k/KAjPrl6gg4olcnSnO cIBQShE9MMRoiNOWlHyECVB888XgzQQ= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 05/28] mfd: mt6397-irq: Remove #ifdef guards for PM related functions Date: Sun, 7 Aug 2022 16:52:24 +0200 Message-Id: <20220807145247.46107-6-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 Cc: Matthias Brugger 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 2924919da991..69009d119216 100644 --- a/drivers/mfd/mt6397-irq.c +++ b/drivers/mfd/mt6397-irq.c @@ -52,7 +52,6 @@ static void mt6397_irq_enable(struct irq_data *data) mt6397->irq_masks_cur[reg] |=3D BIT(shift); } =20 -#ifdef CONFIG_PM_SLEEP static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on) { struct mt6397_chip *mt6397 =3D irq_data_get_irq_chip_data(irq_data); @@ -66,9 +65,6 @@ static int mt6397_irq_set_wake(struct irq_data *irq_data,= unsigned int on) =20 return 0; } -#else -#define mt6397_irq_set_wake NULL -#endif =20 static struct irq_chip mt6397_irq_chip =3D { .name =3D "mt6397-irq", @@ -76,7 +72,7 @@ static struct irq_chip mt6397_irq_chip =3D { .irq_bus_sync_unlock =3D mt6397_irq_sync_unlock, .irq_enable =3D mt6397_irq_enable, .irq_disable =3D mt6397_irq_disable, - .irq_set_wake =3D mt6397_irq_set_wake, + .irq_set_wake =3D pm_sleep_ptr(mt6397_irq_set_wake), }; =20 static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg, --=20 2.35.1