Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2022865rwd; Thu, 18 May 2023 23:02:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+BjiS6mHJv9RT9mu4il/Y9xbLjVZDUCNemLyYE1Upigli+lwo0jQcpS6OWIJ/ngreOIU1 X-Received: by 2002:a05:6a20:43a5:b0:104:edde:67be with SMTP id i37-20020a056a2043a500b00104edde67bemr937262pzl.17.1684476158181; Thu, 18 May 2023 23:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684476158; cv=none; d=google.com; s=arc-20160816; b=THn+7LPvKjELjAZ4GSQdym2A/wwORGXtWVgpP/BjrixWNSxB0pv5ylB3pjTpEPn3gb lT5gNe1uqMWYNg7qddp5d3HnRABn63sHuHhdPfZ3MCE4nK5VrFtR/yNFXO414sNkMuQX pZuN17E9YFGGEEMw74K3kT45i2DW5DxBUa4svmp48a+R3m8+YeLaH9bfGwg+u+DNafYM cnE01/jX8pStwzQ3NiY/N8m6AkYhNFuZsbWI9hTzn5lmTmBL2EpDDVo5BtJ1De7mmwez o4Dw2af0TRjSxaD4OIVM0WPnzpJ+XOWuWp9vO4XYxhxJznLj2ZaEohoGFPuldUEnGOlc hZ/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=0ZTWzBBV4TM6xFllHAVczKx1Ad4G2l/cAuKl4BwKCZU=; b=dMkbRiaYd5T9xrm/wWk5VsH012w/GDMBi2wCJdLqVSPP2glR5bPuzPK9WbtjXGwlqC 7NmLtaoPyQSfBDvuz1yifMiSeMV6rEnvizRGnPFB1kEVnBKGNRS7QT5ZLNE9duo91hSo w0tlBtlqoGTQfIQnn1HBrkHwvQAreBiOK6yjrNp1tj/Js7sWhkmimbS+8n2u6WCS+rmV VsFqcTD8ds0bAPDvB19vJlcqXYwu6C50BYhTGHTFFVoryvcGk3XLJilvx9VJSqWbFMc4 SVThHJU6WkLxk6YUNKV07lKv8gBXP47F7vQST8Mwwal2Vd4fE2EZi/SQy2VMGMjKMHcC ZnCQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020a63b553000000b0053051c56825si2422097pgo.777.2023.05.18.23.02.24; Thu, 18 May 2023 23:02: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229676AbjESFoi (ORCPT + 99 others); Fri, 19 May 2023 01:44:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjESFog (ORCPT ); Fri, 19 May 2023 01:44:36 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F3B0F10C9; Thu, 18 May 2023 22:44:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 027F980F7; Fri, 19 May 2023 05:44:33 +0000 (UTC) Date: Fri, 19 May 2023 08:44:31 +0300 From: Tony Lindgren To: Arnd Bergmann Cc: Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Lukas Wunner , Andy Shevchenko , Matthias Schiffer , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH] serial: 8250: omap: convert to modern PM ops Message-ID: <20230519054431.GV14287@atomide.com> References: <20230517202012.634386-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230517202012.634386-1-arnd@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 * Arnd Bergmann [230517 20:20]: > 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. This looks good to me as an alternative for Geert's fix. If Geert's fix gets applied first, this needs to be rabased. Reviewed-by: Tony Lindgren > 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 >