From patchwork Wed May 17 20:20:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 95535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp35280vqo; Wed, 17 May 2023 13:30:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ORJuHLKXxYg1RJ8SvDGUE3WM4Pct0llLN9m3okWTtTwTi1JtQTX3+6bgxImHPSVjkfT7/ X-Received: by 2002:a05:6a20:9384:b0:105:f40f:c225 with SMTP id x4-20020a056a20938400b00105f40fc225mr16741434pzh.10.1684355438974; Wed, 17 May 2023 13:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684355438; cv=none; d=google.com; s=arc-20160816; b=rZXxQY8WLKelsEEAN/ZMScM+ojwcjC/TRsnyQW4UlIXvBa8aiiLiqZxlbdYM5wAOYe qAvjAMa+4hnsFoWf7Gl2fTqZyQhAAIQPDSWdhnCKY2WKfv8X1wIfluF/xA/pUQI9KIid 6KY0+1aJ94YDCcvOJgSkTut3sPTpOWOBBwKxWx0euQA1B86cjSLXb/rVdUlTMmitT8eI tTOqfTwYajEKILebrDzd63TDN+SsuF31VEz9oz9kVehkggZJi2LR4QEN5wOG3QN94/S6 wCFNC1XMrtiA8+VCgj+NCwpiyPacdF82t74dwlfogaZPP2dUZ5WPIQW8KscfimNzhiID PWQA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a636e03000000b0053059dfafe4si19257261pgc.86.2023.05.17.13.30.24; Wed, 17 May 2023 13:30:38 -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 S229662AbjEQUUX (ORCPT + 99 others); Wed, 17 May 2023 16:20:23 -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_J=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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766174688531769415?= X-GMAIL-MSGID: =?utf-8?q?1766174688531769415?= 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 Reviewed-by: Tony Lindgren --- 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,