From nobody Wed Apr 8 06:41:21 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 1B621ECAAA1 for ; Sun, 23 Oct 2022 09:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbiJWJun (ORCPT ); Sun, 23 Oct 2022 05:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbiJWJub (ORCPT ); Sun, 23 Oct 2022 05:50:31 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14FEF51A1A for ; Sun, 23 Oct 2022 02:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518547; 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=41LrJxU80KiCvA5q7AmgY7aUdotJZRC7pzTXsCNxuuM=; b=V8D/Jee3FZyV0+Iwh4Ob6cs7rOCY+4P4GLLr+8DhMPwWVSigTbLXmPbwDMQu7QSCkQjJv6 Nd+rOqbOch6fezbHmrdsIIv5h2lsw19Gs/s4wK+FnEbbwH5BRDcMopJ6ZmOpxcRhnAp0aF KGIsP+1CIqWJPN5Z5G2rr76IwjEDIiE= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 07/28] mfd: rc5t583-irq: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:31 +0100 Message-Id: <20221023094852.8035-8-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: 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. 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 --- drivers/mfd/rc5t583-irq.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/rc5t583-irq.c b/drivers/mfd/rc5t583-irq.c index b374a3d34688..621ea61fa7c6 100644 --- a/drivers/mfd/rc5t583-irq.c +++ b/drivers/mfd/rc5t583-irq.c @@ -228,15 +228,12 @@ static void rc5t583_irq_sync_unlock(struct irq_data *= irq_data) =20 mutex_unlock(&rc5t583->irq_lock); } -#ifdef CONFIG_PM_SLEEP + static int rc5t583_irq_set_wake(struct irq_data *irq_data, unsigned int on) { struct rc5t583 *rc5t583 =3D irq_data_get_irq_chip_data(irq_data); return irq_set_irq_wake(rc5t583->chip_irq, on); } -#else -#define rc5t583_irq_set_wake NULL -#endif =20 static irqreturn_t rc5t583_irq(int irq, void *data) { @@ -317,7 +314,7 @@ static struct irq_chip rc5t583_irq_chip =3D { .irq_bus_lock =3D rc5t583_irq_lock, .irq_bus_sync_unlock =3D rc5t583_irq_sync_unlock, .irq_set_type =3D rc5t583_irq_set_type, - .irq_set_wake =3D rc5t583_irq_set_wake, + .irq_set_wake =3D pm_sleep_ptr(rc5t583_irq_set_wake), }; =20 int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base) --=20 2.35.1