Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5305067rwi; Sun, 23 Oct 2022 03:55:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TIH7bFXXxLTQyI4iqD9uUyHakjv5Nl7c7QxR29DtPWc4Hkdv/zgAvUn54VYvv31ZVzY2Y X-Received: by 2002:a05:6402:5191:b0:45c:dea0:2c7 with SMTP id q17-20020a056402519100b0045cdea002c7mr25404969edd.239.1666522539748; Sun, 23 Oct 2022 03:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666522539; cv=none; d=google.com; s=arc-20160816; b=ofcAFLytYoVUjXnSAqsGf5jDOlZR0TOQ1B809wHDXbNKJZwfRYgpuOm/axC4++PrSD K4nu3zS84D9s7IebnxrRappoy36+g5nui6M3cCKTrkKNXjSF4nYFicexWv6SC4qF/ZwY tKGc5yWH2xuiA4J9Ae/Pegk5rqfIzZx7VFECtMLVsj/QEr9vyNwhXHRKqwlauEmNFfb3 DzXEwSXOSAY8GR4cgy2F4+0WZY/tgWhbsS3SFTjvtPGxHkwgidhxImHFjhPntLQfQj0F I9lHSfpLwRjYTf4dfrk0hvFfFD4JbQby4pgOP0mQXd0E0M12jw2hGZ2Fh5TRQMXb9M5F I3QA== 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=41LrJxU80KiCvA5q7AmgY7aUdotJZRC7pzTXsCNxuuM=; b=qJxU9ZcPHU1dyhF7mnobLCG1jkRMFgY/+TesFfjPMpvqEE88I9i1QwYXnZ4UFrGi1t d2Cjmj3fXar9cF3nHpAHyIFPmsWwaAz1s2x6lmERxn9XMg5TAvcoAoyYcBYCfwCkAM8E NSWfKg1G3LT/x6kpYiTgi84PVsJfiJVobcMEQug1uXGAeItMT5oX/kwfrR5+aUQFq21r oQ+QLLkIJHfAdl0uMJ1zfypkRSO0tOQGLo8Q4adOYYDKt8zuCFWNQiGow5EKPY3mUR/P qBwj+ADqOrExHvtqcmWzwSjMkg0+3kQKzl76zJpI1UwcB8mFZh4OZz1bWJ4mjHpNrI71 8edg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="V8D/Jee3"; 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 m22-20020aa7c2d6000000b0044e9fd71b82si21357440edp.280.2022.10.23.03.55.15; Sun, 23 Oct 2022 03:55:39 -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="V8D/Jee3"; 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 S230203AbiJWJuk (ORCPT + 99 others); Sun, 23 Oct 2022 05:50:40 -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: 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 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 --- 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) 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 = 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 static irqreturn_t rc5t583_irq(int irq, void *data) { @@ -317,7 +314,7 @@ static struct irq_chip rc5t583_irq_chip = { .irq_bus_lock = rc5t583_irq_lock, .irq_bus_sync_unlock = rc5t583_irq_sync_unlock, .irq_set_type = rc5t583_irq_set_type, - .irq_set_wake = rc5t583_irq_set_wake, + .irq_set_wake = pm_sleep_ptr(rc5t583_irq_set_wake), }; int rc5t583_irq_init(struct rc5t583 *rc5t583, int irq, int irq_base) -- 2.35.1