Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2714223rwd; Wed, 17 May 2023 13:25:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gjzU9kUGAlfinBgUzk6//yfkMxJf0gVDIJQYrquWFCDltRhWpHrXsopUFBFHZ0/ZDbc4f X-Received: by 2002:a05:6a00:84d:b0:643:8496:e41c with SMTP id q13-20020a056a00084d00b006438496e41cmr1284975pfk.20.1684355102507; Wed, 17 May 2023 13:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684355102; cv=none; d=google.com; s=arc-20160816; b=Kkg0mXTl5Wovv1kyaH6TiT1dxRyg+ptaZsVI3+xcUV0pQhO9yb8yXLHHmj3EIHoOsY ATobBIN0Cl+fkNxcX8+aOqd9tmlIOeJV17iAGUQ7focE2DIAP71FWnvX2146xQkUXo8i +qXMzdn8jCIZiw9DTWz2bFvD8Lt6xnyvOvz0lRbHs3ZDEW/ax03IoZ48Tfjppey7b7oc kokey2+gnfj3ZJKX9gGt6tt+PYKFOuNYV3GMfJySG6/5Wlr7kDXWUQv8nunmGtflqDGo rXa85PS9sg33CW1ulARZpr2Jw389sxliDK/B3NiyFCCvkTSRbgBuHw3y5411B2I4Od8L /Y0g== 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=nCEqsZIJ0abS/4okVVxrPoBrMBQN+1XB2vGlB4MRU5Q=; b=dHsb7Bu6aOEcjAZhM4BGQVSd5eaViP1iTgJlqjNhvceo/BIQZBPGxDalsrL2kY3BFl 4JHupJE/I2DBLSwlehwrl+hyuJkRJOo43khJZkgaqxkE7u8DFgP8kyB/aUP0LUTkQ5Uz cvgWo+2hCnlYDAlggDoXP5hnuZSL7tzPmceaYhyZMqnMqfINMjOgsJnXfHYwAWa1/IFr GEiwWhDljgTQlAIK0FCbiKVyZFGP9uD5IQX7rDP5QNxdfg49fizFlK8YVaDLFZyz8Y/2 P9npFz3PCCRLzx2A6/RsWveHQBUBRYcI0hkv17ObncX+R1g7oCZ4VRwjZU2eFBEhyr9l f59g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=heAqux+y; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t16-20020aa79470000000b0062d7d3c6cadsi23233293pfq.333.2023.05.17.13.24.48; Wed, 17 May 2023 13:25: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=@kernel.org header.s=k20201202 header.b=heAqux+y; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbjEQUUW (ORCPT + 99 others); Wed, 17 May 2023 16:20:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjEQUUV (ORCPT ); Wed, 17 May 2023 16:20:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC5851FEB; Wed, 17 May 2023 13:20:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78D1464AFF; Wed, 17 May 2023 20:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A9F7C433D2; Wed, 17 May 2023 20:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684354817; bh=tmrEqMSlltVVWCR826sj25ts9zl6YULEBavsqHAY8to=; h=From:To:Cc:Subject:Date:From; b=heAqux+yqXgxXkijDEAiFmUchjVlz/v6KJhWZCe6P5zq4SpPdRo95hufWL9UwLfDP q8bmR8CLw+ubMxjTT4b2nAAqQg254sbAryZReih0XIyrXXsjOcOY0sARWFEPHQe4Ti 7aE7pS3721poCYt4gnaEnUFAo4frdbIXerV9OCscoIG/UWwtOPl0G/7V3DKIFy1D5J qFtrPPY3KrscAD9nAoF8XdyvFiapgeKjwo3JXT/anN1qbPrCCHCc41eKFr4dqObPR9 f27UJY6anzLAiejtanf0SvyuRONjQwe9XmczmWR5NkNcgoua6lafEpyFgebvU9kRI2 i1obqdAcXlLqg== From: Arnd Bergmann To: Greg Kroah-Hartman , Jiri Slaby , Tony Lindgren Cc: Arnd Bergmann , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Lukas Wunner , Andy Shevchenko , Matthias Schiffer , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] serial: 8250: omap: convert to modern PM ops Date: Wed, 17 May 2023 22:20:07 +0200 Message-Id: <20230517202012.634386-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 From: Arnd Bergmann The new uart_write() function is only called from suspend/resume code, causing a build warning when those are left out: drivers/tty/serial/8250/8250_omap.c:169:13: error: 'uart_write' defined but not used [-Werror=unused-function] Remove the #ifdefs and use the modern pm_ops/pm_sleep_ops and their wrappers to let the compiler see where it's used but still drop the dead code. Fixes: 398cecc24846 ("serial: 8250: omap: Fix imprecise external abort for omap_8250_pm()") Signed-off-by: Arnd Bergmann --- drivers/tty/serial/8250/8250_omap.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 5c093dfcee1d..00b2c35042ee 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -1571,7 +1571,6 @@ static int omap8250_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int omap8250_prepare(struct device *dev) { struct omap8250_priv *priv = dev_get_drvdata(dev); @@ -1616,12 +1615,7 @@ static int omap8250_resume(struct device *dev) serial8250_resume_port(priv->line); return 0; } -#else -#define omap8250_prepare NULL -#define omap8250_complete NULL -#endif -#ifdef CONFIG_PM static int omap8250_lost_context(struct uart_8250_port *up) { u32 val; @@ -1738,7 +1732,6 @@ static int omap8250_runtime_resume(struct device *dev) schedule_work(&priv->qos_work); return 0; } -#endif #ifdef CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP static int __init omap8250_console_fixup(void) @@ -1781,17 +1774,17 @@ console_initcall(omap8250_console_fixup); #endif static const struct dev_pm_ops omap8250_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume) - SET_RUNTIME_PM_OPS(omap8250_runtime_suspend, + SYSTEM_SLEEP_PM_OPS(omap8250_suspend, omap8250_resume) + RUNTIME_PM_OPS(omap8250_runtime_suspend, omap8250_runtime_resume, NULL) - .prepare = omap8250_prepare, - .complete = omap8250_complete, + .prepare = pm_sleep_ptr(omap8250_prepare), + .complete = pm_sleep_ptr(omap8250_complete), }; static struct platform_driver omap8250_platform_driver = { .driver = { .name = "omap8250", - .pm = &omap8250_dev_pm_ops, + .pm = pm_ptr(&omap8250_dev_pm_ops), .of_match_table = omap8250_dt_ids, }, .probe = omap8250_probe, -- 2.39.2