Message ID | 20221023094852.8035-8-paul@crapouillou.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1564539wrr; Sun, 23 Oct 2022 03:54:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5bCzR8VGh44noUDAyaLh86M6kyGV/iYD60ZZe3bP9yPRwSG7bwcI0MhplMzofxYi85xTdS X-Received: by 2002:a17:906:3287:b0:78d:8877:d50f with SMTP id 7-20020a170906328700b0078d8877d50fmr22981775ejw.486.1666522488873; Sun, 23 Oct 2022 03:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666522488; cv=none; d=google.com; s=arc-20160816; b=Sz3rzTr5bUWOowvuJB3tgBVzGZ5yVvXuuJ56Wk9K+eZtJ6jGAc2IHMa6AC+WOIAcc+ XTW7wUxIoAJW7PhZTlSdiipzR7yNGUIm8dhzC6RJcmz9aXYR9nw4t+nZPbHa6Rt1ZWJ7 ffswWInvdoPFY4RsYmvgwnGgzxNOINmoH2kBVc/7cGJjMV3Dnr53enWbBfUxCCG5Olai UffHaz+R9hYCTnhqkFBDiLeH2vd6HAoJ56aTTZXFfkeNYfv22Hdkra41tVLyPv51JUCF YQsMedjYXnqg87hAxrfQuoa6Pezzw8fZhrag5xPwWvSHX7vl34ih0Kws7UA+qcSObI7V u15A== 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 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.54.24; Sun, 23 Oct 2022 03:54:48 -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 <rfc822;pwkd43@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <paul@crapouillou.net> To: Lee Jones <lee@kernel.org> Cc: linux-kernel@vger.kernel.org, Paul Cercueil <paul@crapouillou.net> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747475485535560819?= X-GMAIL-MSGID: =?utf-8?q?1747475485535560819?= |
Series |
mfd: Remove #ifdef guards for PM functions
|
|
Commit Message
Paul Cercueil
Oct. 23, 2022, 9:48 a.m. UTC
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 <paul@crapouillou.net>
---
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)