From patchwork Thu Jun 16 14:00:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12883917 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 01D1CC433EF for ; Thu, 16 Jun 2022 14:04:10 +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=XDaEkrmlbqEglLIvrJ+Zeh/yZ4hjuTRaQTO6L0454kw=; b=j9rsg+76Kuutfv 44D3IcYhTAMBdGc3Pa3QfmjHJhJsDjnpzyTRXc1Fmtol8ed3vQy0GlYOuLzlwlfMfGiWvHo6wx8UT YyCrkBl9sLZfQ1ymDyTbdogdRwCZif+giHGQSe7ogmy6Zvd46Qs5jwgfLDwPnZaCWzoekkdjUF6iE xjE/rqxss47sfRUP7QqE0vZ77hdG45CpiQUNtecpnhZgHaYQqPLplgctAVqIUdv4Urs3bQgdJ4fLy Sa677No1GZ3Zjtjjzve/vNRIqk8v/MrD+/Q5WOSAxMhken7/LposgZEbjrB/8WzWys5g/dqatYIQb Yw6+c7fgPtHh59qUTVxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1q57-002gai-2S; Thu, 16 Jun 2022 14:02:45 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1q0e-002eUC-82 for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 13:58:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1655387888; x=1686923888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iIYJWJmShwNGkYNuXD5wNnHd+SQL3c/U0f/z+4+WjXc=; b=sf6LgQMW6DVvKIeoBPM59bZh2GEOR3UmG2kzWZEy7vXxQMtH5g/1bVCB uYgoYSZlbKJRYaYeGaGLPJMmv8k5gEO+pfQTg1U0MCAKYY69hdeyyckKi Ym36ZdzNjKqvftNuGrrNwJFVWF/OI5p/7+n0sj7mVb/cw7Mx0V634244J z0D0+EOTl7jgQ7q2iWIO0u8JU1Cc1/neAr8+9kbuoimAKllyfzsJdCHal CBavh4O6DsRwgVQN4njLs6XVChrOq+aY0N1IXyNokCNubMGN/xfHnTEuh W7kAM2Z3b4LMfXRQK1ne/k178v+Lis9E76u2aCf2ivUuXDmezXFkaAY8I g==; X-IronPort-AV: E=Sophos;i="5.92,305,1650956400"; d="scan'208";a="100340842" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 16 Jun 2022 06:58:07 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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; Thu, 16 Jun 2022 06:58:07 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Thu, 16 Jun 2022 06:58:04 -0700 From: Claudiu Beznea To: , , , , , CC: , , , Claudiu Beznea Subject: [PATCH v3 3/4] tty: serial: atmel: remove enable/disable clock due to atmel_console_setup() Date: Thu, 16 Jun 2022 17:00:23 +0300 Message-ID: <20220616140024.2081238-4-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220616140024.2081238-1-claudiu.beznea@microchip.com> References: <20220616140024.2081238-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-20220616_065808_409177_7738CA67 X-CRM114-Status: GOOD ( 11.46 ) 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 Acked-by: Richard Genoud --- drivers/tty/serial/atmel_serial.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 4cec97fd7241..3a94c2bdda72 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -2617,7 +2617,6 @@ static void __init atmel_console_get_options(struct uart_port *port, int *baud, static int __init atmel_console_setup(struct console *co, char *options) { - int ret; struct uart_port *port = &atmel_ports[co->index].uart; struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); int baud = 115200; @@ -2630,10 +2629,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 +2909,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);