Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5053686rwb; Mon, 8 Aug 2022 11:17:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR5kzX+W7lB6rXym+Ww6oj1H/ZYQUrpEWLCb9b0RIbZeIhRC+FtMmROy9oyYcMmkIJqD2rba X-Received: by 2002:a05:6402:3552:b0:43d:a634:3997 with SMTP id f18-20020a056402355200b0043da6343997mr18347735edd.389.1659982622548; Mon, 08 Aug 2022 11:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659982622; cv=none; d=google.com; s=arc-20160816; b=q9Hkj5erzG9hMwlME+FR6XQynAHaF/lFw5OY4vmIRMDD7HPQeowcKNlt07l5f5ntra swEs9bkLbAAhZjMMsIwB2zIpQnvDIZi/x026Lqb6Dneu19NVMCBRyeXqocaZCGfdUqlC mrD2weG8uq/aNZn3atdQzjZXbnbsbyeB1n7KnpxNI4GuY19AZ0/6SHxhz75lDXS8cGKc EIkaNJejQvcSH8ivJkH/WK1V2TlfpXvjrTi0cZpmHqe1IBKYOJgQXDL4/44D0aPHPnVY zVjUq898CYJ4NQf2VZrSt7dzRd3wANtrLI/UyfGLcWUTVntpL/Buwewbxd/MIW/stZyK EuZw== 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=+FBECTcdeQLfSp5bHcYAa/1zAvqLKLLp0tQ+VpGze+A=; b=tUgd14sQB/Mv6eVC05EZ1AY2uHD1cnGoWazBoqlOH+vc1SE94i5mbTlzwc/3lk45j/ 3ew2DuNkjo5Y1134V9usOOkVAUSF9oTv2Lno+GJJbi2hcEWUcuK9S+K49Zk9U2D8x2mO UFrFOeUT1DLIhQLI2uUvX7qdZcs/Qu7mO9s8YZuJKwUbNECTE8S6XeSKJbtV5gyYcASm 6EOGW7e3cWA4j3fSGhdwHlypuGstFJUi//TuuO+plZ1SAZu3PQrwSbeJjVD2XtDkCVhZ q/i+V700hv3Sv4NtxaFUfWoTszAc58gOr7jaKiWitLDnEbKnu6yWofiXOoK9jaG4DWDL 5D3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=OXQCBo5F; 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 ci21-20020a170906c35500b0073046f33772si178135ejb.459.2022.08.08.11.16.33; Mon, 08 Aug 2022 11:17:02 -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=OXQCBo5F; 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 S244088AbiHHRnK (ORCPT + 99 others); Mon, 8 Aug 2022 13:43:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244291AbiHHRmp (ORCPT ); Mon, 8 Aug 2022 13:42:45 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E296277 for ; Mon, 8 Aug 2022 10:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659980502; 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=+FBECTcdeQLfSp5bHcYAa/1zAvqLKLLp0tQ+VpGze+A=; b=OXQCBo5FXH3fsXQ9+jXS+adX5jJl+ptBHGO+bKbqmuBed2aNPbhhG+XfoBUGT8AStcGh/m 8N6GjMmv+7Lx+6RmNMie2G30HNSqNVG94+Cy+v7zNJknFf3YEO63iSiAvSzPLKLm4WGFei OMtKwTQWAo3e8MluzcOTDgAIGnDoSGM= 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 v2 06/30] mfd: mt6397-irq: Remove #ifdef guards for PM related functions Date: Mon, 8 Aug 2022 19:40:43 +0200 Message-Id: <20220808174107.38676-7-paul@crapouillou.net> In-Reply-To: <20220808174107.38676-1-paul@crapouillou.net> References: <20220808174107.38676-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. 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 --- 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 eff53fed8fe7..72f923e47752 100644 --- a/drivers/mfd/mt6397-irq.c +++ b/drivers/mfd/mt6397-irq.c @@ -54,7 +54,6 @@ static void mt6397_irq_enable(struct irq_data *data) mt6397->irq_masks_cur[reg] |= BIT(shift); } -#ifdef CONFIG_PM_SLEEP static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on) { struct mt6397_chip *mt6397 = irq_data_get_irq_chip_data(irq_data); @@ -68,9 +67,6 @@ static int mt6397_irq_set_wake(struct irq_data *irq_data, unsigned int on) return 0; } -#else -#define mt6397_irq_set_wake NULL -#endif static struct irq_chip mt6397_irq_chip = { .name = "mt6397-irq", @@ -78,7 +74,7 @@ static struct irq_chip mt6397_irq_chip = { .irq_bus_sync_unlock = mt6397_irq_sync_unlock, .irq_enable = mt6397_irq_enable, .irq_disable = mt6397_irq_disable, - .irq_set_wake = mt6397_irq_set_wake, + .irq_set_wake = pm_sleep_ptr(mt6397_irq_set_wake), }; static void mt6397_irq_handle_reg(struct mt6397_chip *mt6397, int reg, -- 2.35.1