From patchwork Wed Jun 15 08:31:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12881916 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEAE1C43334 for ; Wed, 15 Jun 2022 08:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CeEV5NnUlPvf129emT3KIZ3IYmxiwbEX080VtZE8EM0=; b=GlyJ2248FJ4zhu yQhYU8ca9MQEUO5xNbnVOY/PsKngKNAIuJvomtGWojzTjaCcQ0/2QJwFMAEBptJpbgTgkPAutzysx jQLVJR0MmzPrdgE1RDiZD3Ftk/6m+j5jrvMPWI98Jk5bz7FtrGHNxlTOGPHinU/vQS4P5HWJvFaly N5P2opPPIFslFaRxoSG6f9Hvn+pfcfAAPjBb6w8Dnahj1fsAzb02OrM6QV65tgdsqi5EdQmet1IfA qM9awY1pQaopbXwZV5Ut/DwUVETIrYWefwDZ5bEGKX6XQ2nuSghfoKOdiky6OO5FHbag8/Haz08fp Cp11GNLC9ZHsHY9L1h4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OP5-00DF8z-De; Wed, 15 Jun 2022 08:29:31 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OOv-00DF6F-N7 for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 08:29:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1655281761; x=1686817761; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RfZ5DFdJl8ReyHkeNxi8ArYfDV2QwPpoPQqNBUZe2G0=; b=eKPNvR8VpcLLpbFCxE0wNCP9DG8tqbvvkalbqyO485dCL7yHLbb03JjU p2qfU9lCn94J2Ad4anthJJSIMDZU1yNifIEkpSnOn0sd1lfx0oz8trbsO ddMGlL924iazlcVX8J/6tgyZnrxF1xsOwS1ZxlEaglWW+vMAGBWNqMdSh 7kfJ0IhGjNjWyOSpjM9uqp5xh0vVB22NVxuoyNOsEGEHo+cUG0G6/mxo1 EaiEEPmlRt0oTuQ8X/kzirkNtGRzlbGn74VhWVWaS/2iwW0GU4Na58Nl+ 53ur/VpIcAssEa/HC+x57muaztcIgFT1fVRv1LzIGW6yzZcnHRq2Y5E+5 A==; X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="178025169" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jun 2022 01:29:21 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 15 Jun 2022 01:29:20 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 15 Jun 2022 01:29:18 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v2 1/4] tty: serial: atmel: stop using legacy pm ops Date: Wed, 15 Jun 2022 11:31:41 +0300 Message-ID: <20220615083144.1882142-2-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220615083144.1882142-1-claudiu.beznea@microchip.com> References: <20220615083144.1882142-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_012921_776264_FE11156E X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Stop using legacy PM ops and switch using dev_pm_ops. Along with it #ifdef CONFIG_PM are removed and __maybe_unused and pm_ptr() used instead. Coding style recommends (at chapter Conditional Compilation) to avoid using preprocessor conditional and use __maybe_unused instead. Signed-off-by: Claudiu Beznea Acked-by: Richard Genoud --- drivers/tty/serial/atmel_serial.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 74dd1d3ac46f..c618d7e93058 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -166,7 +166,6 @@ struct atmel_uart_port { unsigned int fidi_min; unsigned int fidi_max; -#ifdef CONFIG_PM struct { u32 cr; u32 mr; @@ -177,7 +176,6 @@ struct atmel_uart_port { u32 fmr; u32 fimr; } cache; -#endif int (*prepare_rx)(struct uart_port *port); int (*prepare_tx)(struct uart_port *port); @@ -2718,7 +2716,6 @@ static struct uart_driver atmel_uart = { .cons = ATMEL_CONSOLE_DEVICE, }; -#ifdef CONFIG_PM static bool atmel_serial_clk_will_stop(void) { #ifdef CONFIG_ARCH_AT91 @@ -2728,10 +2725,9 @@ static bool atmel_serial_clk_will_stop(void) #endif } -static int atmel_serial_suspend(struct platform_device *pdev, - pm_message_t state) +static int __maybe_unused atmel_serial_suspend(struct device *dev) { - struct uart_port *port = platform_get_drvdata(pdev); + struct uart_port *port = dev_get_drvdata(dev); struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); if (uart_console(port) && console_suspend_enabled) { @@ -2756,14 +2752,14 @@ static int atmel_serial_suspend(struct platform_device *pdev, } /* we can not wake up if we're running on slow clock */ - atmel_port->may_wakeup = device_may_wakeup(&pdev->dev); + atmel_port->may_wakeup = device_may_wakeup(dev); if (atmel_serial_clk_will_stop()) { unsigned long flags; spin_lock_irqsave(&atmel_port->lock_suspended, flags); atmel_port->suspended = true; spin_unlock_irqrestore(&atmel_port->lock_suspended, flags); - device_set_wakeup_enable(&pdev->dev, 0); + device_set_wakeup_enable(dev, 0); } uart_suspend_port(&atmel_uart, port); @@ -2771,9 +2767,9 @@ static int atmel_serial_suspend(struct platform_device *pdev, return 0; } -static int atmel_serial_resume(struct platform_device *pdev) +static int __maybe_unused atmel_serial_resume(struct device *dev) { - struct uart_port *port = platform_get_drvdata(pdev); + struct uart_port *port = dev_get_drvdata(dev); struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); unsigned long flags; @@ -2808,14 +2804,10 @@ static int atmel_serial_resume(struct platform_device *pdev) spin_unlock_irqrestore(&atmel_port->lock_suspended, flags); uart_resume_port(&atmel_uart, port); - device_set_wakeup_enable(&pdev->dev, atmel_port->may_wakeup); + device_set_wakeup_enable(dev, atmel_port->may_wakeup); return 0; } -#else -#define atmel_serial_suspend NULL -#define atmel_serial_resume NULL -#endif static void atmel_serial_probe_fifos(struct atmel_uart_port *atmel_port, struct platform_device *pdev) @@ -3019,14 +3011,16 @@ static int atmel_serial_remove(struct platform_device *pdev) return ret; } +static SIMPLE_DEV_PM_OPS(atmel_serial_pm_ops, atmel_serial_suspend, + atmel_serial_resume); + static struct platform_driver atmel_serial_driver = { .probe = atmel_serial_probe, .remove = atmel_serial_remove, - .suspend = atmel_serial_suspend, - .resume = atmel_serial_resume, .driver = { .name = "atmel_usart_serial", .of_match_table = of_match_ptr(atmel_serial_dt_ids), + .pm = pm_ptr(&atmel_serial_pm_ops), }, }; From patchwork Wed Jun 15 08:31:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12881918 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62DA1C433EF for ; Wed, 15 Jun 2022 08:30:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VfO59nm2652GpKJyLIjNpoeLs5yjLFiSpbJ4R7Dh/CE=; b=GjipkbJV4tx8HP waW1XIG34ZcpSlV7RTeKLGOC87XGeNUZ82jo47HVotQZCJOs7/Sd5kWOR0HZ7Q6PID7rF7xJxaApy jtLLXz42Dx2ptZuIrA80mVNh9r1RTV3B/vphgmnwL6borV6opHPewDK4/mih37zQDj30duMFkGZkQ oX35mJCE1ILV3PzXYoFbCbfXxEfTZnn33eeM7uP1Nqpralpx/ht0VLX0RHRmFjyp1VHjMMmHXXXR9 s9e0ytNBSKFNWhNNkq1tjZO7S0qNsvs5qunOJ8mrHRfHYnFn/UBvkZ9+ea5zjYcx1ms6fizp4AL6U 4x68/xY8TIPFbs0C2+kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OPO-00DFDa-3S; Wed, 15 Jun 2022 08:29:50 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OP6-00DF9V-KG for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 08:29:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1655281772; x=1686817772; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ju4A9HIwXXampZCizRhHHBmfACjludeE+ouDKRJsveQ=; b=T+rgdJvLfYLmmw+twRt5Ck2IBdZzsBuJ0bghsI2kVjU54AW+ecCZkxlg gQWC7QS2IsFaMeDvNWhUijNFsdvhnZUWNr3Pz6MTHw5hrMpVj18Eg6QuA 9c0DacgU0Ezc8unTAU6K6rW/+WAnIiz1GQ5hzMX/8o0ayD5bymMCHjIBZ AOcV4NteDfl3VindUNZ9YgoOKOh/4f30bC5ckzLwsHd2BSm62vZyZEkf9 PWIyxsMH71108LJuFegPFUcyZsVCZWFQoNRRwyER9fobxrT4gds1UdKa4 pj4cam3fSdn2CAg7YyzRZaTx+Lugu4bDjLBxYVhlGRwomdND+Woo00fVI A==; X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="178025223" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jun 2022 01:29:32 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 15 Jun 2022 01:29:23 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 15 Jun 2022 01:29:21 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v2 2/4] tty: serial: atmel: use devm_clk_get() Date: Wed, 15 Jun 2022 11:31:42 +0300 Message-ID: <20220615083144.1882142-3-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220615083144.1882142-1-claudiu.beznea@microchip.com> References: <20220615083144.1882142-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_012932_718905_1FA46CBE X-CRM114-Status: GOOD ( 13.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use devm_clk_get() for serial clock instead of clk_get()/clk_put(). With this move the clk_get in driver's probe function. Signed-off-by: Claudiu Beznea --- drivers/tty/serial/atmel_serial.c | 50 ++++++++++--------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index c618d7e93058..4cec97fd7241 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2508,24 +2508,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port, if (ret) return ret; - /* for console, the clock could already be configured */ - if (!atmel_port->clk) { - atmel_port->clk = clk_get(&mpdev->dev, "usart"); - if (IS_ERR(atmel_port->clk)) { - ret = PTR_ERR(atmel_port->clk); - atmel_port->clk = NULL; - return ret; - } - ret = clk_prepare_enable(atmel_port->clk); - if (ret) { - clk_put(atmel_port->clk); - atmel_port->clk = NULL; - return ret; - } - port->uartclk = clk_get_rate(atmel_port->clk); - clk_disable_unprepare(atmel_port->clk); - /* only enable clock when USART is in use */ - } + port->uartclk = clk_get_rate(atmel_port->clk); /* * Use TXEMPTY for interrupt when rs485 or ISO7816 else TXRDY or @@ -2896,14 +2879,23 @@ static int atmel_serial_probe(struct platform_device *pdev) atomic_set(&atmel_port->tasklet_shutdown, 0); spin_lock_init(&atmel_port->lock_suspended); + atmel_port->clk = devm_clk_get(&pdev->dev, "usart"); + if (IS_ERR(atmel_port->clk)) { + ret = PTR_ERR(atmel_port->clk); + goto err; + } + ret = clk_prepare_enable(atmel_port->clk); + if (ret) + goto err; + ret = atmel_init_port(atmel_port, pdev); if (ret) - goto err_clear_bit; + goto err_clk_disable_unprepare; atmel_port->gpios = mctrl_gpio_init(&atmel_port->uart, 0); if (IS_ERR(atmel_port->gpios)) { ret = PTR_ERR(atmel_port->gpios); - goto err_clear_bit; + goto err_clk_disable_unprepare; } if (!atmel_use_pdc_rx(&atmel_port->uart)) { @@ -2912,7 +2904,7 @@ static int atmel_serial_probe(struct platform_device *pdev) sizeof(struct atmel_uart_char), GFP_KERNEL); if (!data) - goto err_alloc_ring; + goto err_clk_disable_unprepare; atmel_port->rx_ring.buf = data; } @@ -2936,12 +2928,6 @@ static int atmel_serial_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 1); platform_set_drvdata(pdev, atmel_port); - /* - * The peripheral clock has been disabled by atmel_init_port(): - * enable it before accessing I/O registers - */ - clk_prepare_enable(atmel_port->clk); - if (rs485_enabled) { atmel_uart_writel(&atmel_port->uart, ATMEL_US_MR, ATMEL_US_USMODE_NORMAL); @@ -2965,12 +2951,8 @@ static int atmel_serial_probe(struct platform_device *pdev) err_add_port: kfree(atmel_port->rx_ring.buf); atmel_port->rx_ring.buf = NULL; -err_alloc_ring: - if (!uart_console(&atmel_port->uart)) { - clk_put(atmel_port->clk); - atmel_port->clk = NULL; - } -err_clear_bit: +err_clk_disable_unprepare: + clk_disable_unprepare(atmel_port->clk); clear_bit(atmel_port->uart.line, atmel_ports_in_use); err: return ret; @@ -3004,8 +2986,6 @@ static int atmel_serial_remove(struct platform_device *pdev) clear_bit(port->line, atmel_ports_in_use); - clk_put(atmel_port->clk); - atmel_port->clk = NULL; pdev->dev.of_node = NULL; return ret; From patchwork Wed Jun 15 08:31:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12881917 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF2F4C43334 for ; Wed, 15 Jun 2022 08:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5bdvtpUU918I7rSGWX2ubjJwRefDGIXuqmsXVCr+hkg=; b=hq3UDrbQTcQR03 65et6bVEieLAgvxpqeyVgO5PvnnT5KMfxDVrPxEGDoCA8mZ/9acKAF5uQMECy8Yv/11YQO+TL446Z 0v5f/zoxEBAupXvlXJuAVYYmYpdGF7Hg+DemGdQffjWfxseImrr9vrMzpynN0MPgbiqdU0mroHoPy CCICs8wYynkpy0ySwTg+R5fxOqDxqjELvvwVkNt9y+wybbMIu4DThxZoH2+H5ZAVD2BHsq2WfSAVP nypLwADoSqzvwx8NKlRA/kgOMEEvJLp/q/Zmg3PTZq1kW1qGXuPaA10qnmsmzKgzYCZ/Sb/Ly2P7c 6AvVpulyUoNzmM+n0sxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OPE-00DFBC-EW; Wed, 15 Jun 2022 08:29:40 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OP1-00DF8F-Ke for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 08:29:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1655281767; x=1686817767; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s2w3cZlQKmR9BHINpZiLGIOhcN/Hegit5K57L5jWoHw=; b=TwI7J4P071lI25QoVlsJr+jxcPyjsqx5hBWMfdjD8VKj6hlpN3BAlejC XAhWSrSh/ezujWWXtc8yGqvogTDrpmtdULNjsq/4t7K2+T/Q15k6nFS80 vDrrIueNi45fQwyC92ZwBwhnzHXkdS5sqOWzgtTBxJZzONapcQUGEX5Yi b3RMoHps3K2c0RUvbB6CNv5Vi79BP2i0QfM0RtvxSGwVTnJxoQBKe2o59 MNVJvBq0GyOaL/Y35XTVsDP+7/npwhdcZIJ2R966zEYurfriuERr1BeaP nZ2rGrmG+5f0aNXxMA67kU7A5Qeu/QHXXGBrz5TSyhPa1o/Po57xhb29f w==; X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="168487083" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jun 2022 01:29:27 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 15 Jun 2022 01:29:26 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 15 Jun 2022 01:29:24 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v2 3/4] tty: serial: atmel: remove enable/disable clock due to atmel_console_setup() Date: Wed, 15 Jun 2022 11:31:43 +0300 Message-ID: <20220615083144.1882142-4-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220615083144.1882142-1-claudiu.beznea@microchip.com> References: <20220615083144.1882142-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_012927_719267_C31D10CB X-CRM114-Status: GOOD ( 10.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is no need for clk_prepare_enable() at the beginning of atmel_console_setup() and clk_disable_unprepare() at the end of atmel_console_setup() as the clock is already enabled when calling atmel_console_setup() and its disablement is done at the end of probe. Signed-off-by: Claudiu Beznea --- drivers/tty/serial/atmel_serial.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 4cec97fd7241..51835c7ce827 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2630,10 +2630,6 @@ static int __init atmel_console_setup(struct console *co, char *options) return -ENODEV; } - ret = clk_prepare_enable(atmel_ports[co->index].clk); - if (ret) - return ret; - atmel_uart_writel(port, ATMEL_US_IDR, -1); atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX); atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN); @@ -2914,17 +2910,6 @@ static int atmel_serial_probe(struct platform_device *pdev) if (ret) goto err_add_port; -#ifdef CONFIG_SERIAL_ATMEL_CONSOLE - if (uart_console(&atmel_port->uart) - && ATMEL_CONSOLE_DEVICE->flags & CON_ENABLED) { - /* - * The serial core enabled the clock for us, so undo - * the clk_prepare_enable() in atmel_console_setup() - */ - clk_disable_unprepare(atmel_port->clk); - } -#endif - device_init_wakeup(&pdev->dev, 1); platform_set_drvdata(pdev, atmel_port); From patchwork Wed Jun 15 08:31:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12881919 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11873C433EF for ; Wed, 15 Jun 2022 08:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WWKMGsG3+yY1cfQgSO1g0iGBW7wWzazk0zuKONoMm4I=; b=IPkJ9jmo3Iwuuk GQI3wGWjP/atwav6StpBFfuu275gPW0rbNblkvbTEFPJ14i5cdeAxPVbDo+gXLZNMH1k5DPYYUWnV X6B0eEXdU9WKIqjFXRuUHgQPAFCb3uVkS5UEtFy+cviOXfDlmr6S3nTTSrlHOsEJ9TdLdRFtIsY8X mCHpg5lJEOcdulhxsrocBibOkOzwHSeLgLe3GM9KLq1wkKvy9nd+4IxxBZtrW/5f6JbUlgsPBNyMY lrQve9YKsTil3JTmQchK0F9r0CgOQqkZR2wlWlyZAP5XpQgg+JkQjoJ4Ml9dvnOfXP5c/R7hnGyVW 6/ARqrIv5YkgX+XkagYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OPl-00DFN9-JK; Wed, 15 Jun 2022 08:30:13 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1OP8-00DF9V-Vf for linux-arm-kernel@lists.infradead.org; Wed, 15 Jun 2022 08:29:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1655281774; x=1686817774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D/GW/lXKpR6TmmSVXUJ9+ZueanAvikeiMgT1O9er88U=; b=uIdqJ3tASw+Ve3aMjtPMs23rW0qwPUe5R7H52BdxSASvZ8o/gY8/Jl2M 1dsVfoakRclW5D73YCNBe9Cum5xO62mHS/Qqq8mCVqIKk186y7uQcBN/P WeLeKpv7HM07Mbpe7b8BVCU3WcjB+ova4kh8AahIlVU5B95fQpTnrmNuF ZwK3tzd2nF3q6JFWR1VcKUCGWi8b8gXZN7ERAitSKJoMHxVM3gmccV5rM RzNrOTOeSF8drM8Sn8kMY5Xsx8gSzD/yw3r+kRQz+/se7MEARrIckeKyv 9tYJoraEb9PlQ6pd/2jf6RlMQ9Zemp6CfxJ2Rknw57N3ly9r/mGkdeglF g==; X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="178025240" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jun 2022 01:29:34 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 15 Jun 2022 01:29:29 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Wed, 15 Jun 2022 01:29:26 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v2 4/4] serial: st-asc: remove include of pm_runtime.h Date: Wed, 15 Jun 2022 11:31:44 +0300 Message-ID: <20220615083144.1882142-5-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220615083144.1882142-1-claudiu.beznea@microchip.com> References: <20220615083144.1882142-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220615_012935_042437_FB004871 X-CRM114-Status: UNSURE ( 8.35 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org st-asc driver doesn't use helpers from pm_runtime.h thus remove its include. Signed-off-by: Claudiu Beznea Reviewed-by: Patrice Chotard --- drivers/tty/serial/st-asc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 1b0da603ab54..cce42f4c9bc2 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include