From nobody Sun Feb 8 05:23:49 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 46457EB64D7 for ; Sun, 18 Jun 2023 15:40:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbjFRPjs (ORCPT ); Sun, 18 Jun 2023 11:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjFRPjr (ORCPT ); Sun, 18 Jun 2023 11:39:47 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215D1E4F for ; Sun, 18 Jun 2023 08:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1687102784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yU6rdYSr0fdjxZNOHrIN3OBxjocoOCe94dU5mt/YZD8=; b=grHSJzDIjuXQPAmynNUh7dFvbw/kpQ5wpXyTZ93L4DC+Vy/UFJnDtPovISmYY9+Rj3mZC6 rYVFZFC99SOuYYWKvuD5otizWSfpCW0AX6KCO6eHNYhnfWGKWNKF7uj+uZCktYC5HIgNgW o52SoXtMBZRM1fj+mXn2kzQ7RaGWSPk= From: Paul Cercueil To: Daniel Lezcano , Thomas Gleixner Cc: list@opendingux.net, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH] clocksource: ingenic-timer: Use pm_sleep_ptr() macro Date: Sun, 18 Jun 2023 17:39:37 +0200 Message-Id: <20230618153937.96649-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" The use of the pm_sleep_ptr() macro allows the compiler to always see the dev_pm_ops structure and related functions, while still allowing the unused code to be removed, without the need for the __maybe_unused markings. Signed-off-by: Paul Cercueil --- drivers/clocksource/ingenic-timer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/clocksource/ingenic-timer.c b/drivers/clocksource/inge= nic-timer.c index 089ce64b1c3f..154ee5f7954a 100644 --- a/drivers/clocksource/ingenic-timer.c +++ b/drivers/clocksource/ingenic-timer.c @@ -369,7 +369,7 @@ static int __init ingenic_tcu_probe(struct platform_dev= ice *pdev) return 0; } =20 -static int __maybe_unused ingenic_tcu_suspend(struct device *dev) +static int ingenic_tcu_suspend(struct device *dev) { struct ingenic_tcu *tcu =3D dev_get_drvdata(dev); unsigned int cpu; @@ -382,7 +382,7 @@ static int __maybe_unused ingenic_tcu_suspend(struct de= vice *dev) return 0; } =20 -static int __maybe_unused ingenic_tcu_resume(struct device *dev) +static int ingenic_tcu_resume(struct device *dev) { struct ingenic_tcu *tcu =3D dev_get_drvdata(dev); unsigned int cpu; @@ -406,7 +406,7 @@ static int __maybe_unused ingenic_tcu_resume(struct dev= ice *dev) return ret; } =20 -static const struct dev_pm_ops __maybe_unused ingenic_tcu_pm_ops =3D { +static const struct dev_pm_ops ingenic_tcu_pm_ops =3D { /* _noirq: We want the TCU clocks to be gated last / ungated first */ .suspend_noirq =3D ingenic_tcu_suspend, .resume_noirq =3D ingenic_tcu_resume, @@ -415,9 +415,7 @@ static const struct dev_pm_ops __maybe_unused ingenic_t= cu_pm_ops =3D { static struct platform_driver ingenic_tcu_driver =3D { .driver =3D { .name =3D "ingenic-tcu-timer", -#ifdef CONFIG_PM_SLEEP - .pm =3D &ingenic_tcu_pm_ops, -#endif + .pm =3D pm_sleep_ptr(&ingenic_tcu_pm_ops), .of_match_table =3D ingenic_tcu_of_match, }, }; --=20 2.39.2