From patchwork Sun Jun 18 15:39:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 109632 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2548556vqr; Sun, 18 Jun 2023 09:34:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yun9x5fHDBCw9GSXrb9SGSgxIbAMzv2skl0x6K4Ly2dbgHcuD9aABh3Y3PiQ9dc/0pzCc X-Received: by 2002:a17:902:c40c:b0:1b5:3aed:b078 with SMTP id k12-20020a170902c40c00b001b53aedb078mr8665975plk.53.1687106093875; Sun, 18 Jun 2023 09:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687106093; cv=none; d=google.com; s=arc-20160816; b=JlTeOHLyfYaLPGSBe5Dezkl2ky8JTRiOpPDHyS2VSTk25jTWAKlmiZmQH+o9tcR9SM lngzeVD+4NIs+55IOMfAUmG9lrweMTiIfV9otbIxkJFgAtYROPa0yhL9gueT3GJEm1rl q52WXMZ8Mrn9DUfHXvionaQT8ci9rIq2feGluqYLq3LlC8aCy0aryBit7WzViiT0iHFG crX+vI0UGNVM8o03/m4F5G1vpNEzQ+HzCqWd09MHtBYcGNdffwxCac/EHEblzTR+C7Dm fyqDhQLrU3M0xEWQBBGHPU9d6EceMr444By7JShSAmp/6Cw+1en6lONYJ1XDg2k65g08 HRAg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=yU6rdYSr0fdjxZNOHrIN3OBxjocoOCe94dU5mt/YZD8=; b=BnMpD/b8atgw1vqdk8GGB8qTeJyiRNgJvo0UHaP+LQt9sODhR5S9kW6wQQ6cWXa74Y tFEXDD9ujgFgl6d+6UEEbU4S7bKj/doPiILaH/NHYKKZ9UiF90gt0pQmw2QHyJlQmKOr L1Md9JW47Iz9B6ax1qRNTEQfh45R5tlW6T8UJBnaPnOSm+3+cseM3q55z6B8IqhzdglC eKbYjmVaJnrC0mMMQ6O9cagQ33H4RCoHt3m5Ld5O/RP3lUHKjwXlQoKIC/pJzIBmE1Zi jq1RMwSZQrWrzhnQ+I3x2gfgnWo+AIcXWffYbHqaZZOosach+J26cfUpqabtZPMj+Ju0 0CLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=grHSJzDI; 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 d3-20020a170902cec300b001b25e9a76d7si18115762plg.316.2023.06.18.09.34.15; Sun, 18 Jun 2023 09:34:53 -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=grHSJzDI; 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 S229759AbjFRPjs (ORCPT + 99 others); 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769058959262405831?= X-GMAIL-MSGID: =?utf-8?q?1769058959262405831?= 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/ingenic-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_device *pdev) return 0; } -static int __maybe_unused ingenic_tcu_suspend(struct device *dev) +static int ingenic_tcu_suspend(struct device *dev) { struct ingenic_tcu *tcu = dev_get_drvdata(dev); unsigned int cpu; @@ -382,7 +382,7 @@ static int __maybe_unused ingenic_tcu_suspend(struct device *dev) return 0; } -static int __maybe_unused ingenic_tcu_resume(struct device *dev) +static int ingenic_tcu_resume(struct device *dev) { struct ingenic_tcu *tcu = dev_get_drvdata(dev); unsigned int cpu; @@ -406,7 +406,7 @@ static int __maybe_unused ingenic_tcu_resume(struct device *dev) return ret; } -static const struct dev_pm_ops __maybe_unused ingenic_tcu_pm_ops = { +static const struct dev_pm_ops ingenic_tcu_pm_ops = { /* _noirq: We want the TCU clocks to be gated last / ungated first */ .suspend_noirq = ingenic_tcu_suspend, .resume_noirq = ingenic_tcu_resume, @@ -415,9 +415,7 @@ static const struct dev_pm_ops __maybe_unused ingenic_tcu_pm_ops = { static struct platform_driver ingenic_tcu_driver = { .driver = { .name = "ingenic-tcu-timer", -#ifdef CONFIG_PM_SLEEP - .pm = &ingenic_tcu_pm_ops, -#endif + .pm = pm_sleep_ptr(&ingenic_tcu_pm_ops), .of_match_table = ingenic_tcu_of_match, }, };