From patchwork Thu Oct 19 10:09:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13428545 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 D25F1CDB483 for ; Thu, 19 Oct 2023 10:09: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: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:In-Reply-To:References: List-Owner; bh=u9JRQ22mpixBETBs9a0NM/1/JlUJt4FqWJ08sIyOvTU=; b=XmMUEXV5JakAMo sS+qwMxSTrIgFwPylrsAI2n2MegLHztxxdBTKQQKeGIOPQV4+wYBLGYieugAFStCWHNAmigypOtW5 Ki6nArBlQFyMgi79LZkwIkQhxjwDHijR8wODfqZ6+6ttcpu4LE/2B+UoZCm+tgT+f7cAmtNPG2ugn eyBMiwfWB8VxSvSLKmen6mBz1MAKlIfUHeopOSux0onKz9jPHW2eLv6ZFu+/qhiOYbtIbDa5v1UI8 euwEroc5uWkHYTSw+XePwlp8drgxGkj62I34Dsl4OanLVVwaZSGFvrd/qPEzE7CU+ZBAs5kWeFmCk JZdI9xmIMePoP44PonIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtPxu-00Gub9-1u; Thu, 19 Oct 2023 10:09:18 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtPxm-00GuX4-2y for linux-arm-kernel@lists.infradead.org; Thu, 19 Oct 2023 10:09:12 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4081ccf69dcso3415105e9.0 for ; Thu, 19 Oct 2023 03:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697710148; x=1698314948; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=m0Z7d7ptWbmYJPwApAdIZBvgqObyt8ZWq8dUW8kLFFM=; b=LtV2s8yNsupCTE0OwxHViGyTyo3IPvskX8Mz85ZOSBvloIY/2g4zUtaXD+gRUW8bdg VoO5+L9P8cTd11xwH6b8OOAI75IHGWxQJCwBRxIE4yKcaXbL2OiogvZ87hrv1Ncg/Zea PYi/QZ5AHWNsLsv1XSx6k5FS0fioYaxE+h7SIpuR0dvYTYrv6rqb4lp9biE1fzzFEcu7 qK8pgKubeeecSNx8oSbqeUi4rAXyqPPnBzqrakzvO2AZjDUOssYwf3OLPkbXEe8Ko4yQ y6N4QxHMU3v/zhKAUoOJPA+lggGB1GL4U3LDjQo53NGzsRKsv1aW4AMCy3XdEmjNoYH+ Ko/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697710148; x=1698314948; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m0Z7d7ptWbmYJPwApAdIZBvgqObyt8ZWq8dUW8kLFFM=; b=DDKLpYRMX3ZGwLH0LYU22D64wXYKT7DCeX4x38svgkZGJrp7LA1QdCoIUScRzk0VMO gmGpCOMamEEjRFU9LMYlgmSUuVu+Xuevwqw7u30r841TvPiOfmIzEe9RVdbKuuCugFX0 48x7jLaxJU83rncSycM0fpBPdGQr88bH/SM+V/3zDT/Q/OkZVoQfWCHl42XWLG1D9OwP vPpRmlJdu52KQeLh0rvP7e4+7vw8MTV9+nBPOi3V9R50dIKdSYjitgpP9z98Jt8I3Gf5 IX2XL660NH6eK9M5WaWlQlQuazGzU77YQUBGn6R+EBdXTgVHxDqWkZVD1akOcXMRWSh5 AHxw== X-Gm-Message-State: AOJu0YxCnNxscAIb9NTFqDxECYkKTPlcmBgfJ4fM+WIBQrXMLf31TiRT NOlHespQcQrTRlrGJZhYHX23eg== X-Google-Smtp-Source: AGHT+IEQNnTsvgWz2h4CJCcPkrnu4v9QYZthiac8p3ajy20I9bZMLfCvwec86847lWLW/8Egjyztlg== X-Received: by 2002:a05:600c:602a:b0:407:4126:f71c with SMTP id az42-20020a05600c602a00b004074126f71cmr1407173wmb.6.1697710148522; Thu, 19 Oct 2023 03:09:08 -0700 (PDT) Received: from salami.lan ([80.111.64.44]) by smtp.gmail.com with ESMTPSA id f7-20020a05600c4e8700b00403b63e87f2sm4102122wmq.32.2023.10.19.03.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 03:09:08 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= To: linux-kernel@vger.kernel.org Cc: krzysztof.kozlowski@linaro.org, alim.akhtar@samsung.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2] tty: serial: samsung_tty: remove dead code Date: Thu, 19 Oct 2023 11:09:01 +0100 Message-Id: <20231019100901.4026680-1-andre.draszik@linaro.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231019_030910_967231_813EA653 X-CRM114-Status: GOOD ( 16.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 When support for various old platforms was removed in commit 1ea35b355722 ("ARM: s3c: remove s3c24xx specific hacks"), s3c24xx_serial_ops also became unused here because nothing sets port type TYPE_S3C24XX anymore. Remove s3c24xx_serial_ops and all the code that's unreachable now. Fixes: 1ea35b355722 ("ARM: s3c: remove s3c24xx specific hacks") Signed-off-by: André Draszik Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko --- v2: update commit message --- drivers/tty/serial/samsung_tty.c | 105 ------------------------------- 1 file changed, 105 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 07fb8a9dac63..6b8d4b4402e9 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -64,7 +64,6 @@ #define RXSTAT_DUMMY_READ (0x10000000) enum s3c24xx_port_type { - TYPE_S3C24XX, TYPE_S3C6400, TYPE_APPLE_S5L, }; @@ -128,8 +127,6 @@ struct s3c24xx_uart_dma { }; struct s3c24xx_uart_port { - unsigned char rx_claimed; - unsigned char tx_claimed; unsigned char rx_enabled; unsigned char tx_enabled; unsigned int pm_level; @@ -1166,29 +1163,6 @@ static void s3c24xx_serial_release_dma(struct s3c24xx_uart_port *p) } } -static void s3c24xx_serial_shutdown(struct uart_port *port) -{ - struct s3c24xx_uart_port *ourport = to_ourport(port); - - if (ourport->tx_claimed) { - free_irq(ourport->tx_irq, ourport); - ourport->tx_enabled = 0; - ourport->tx_claimed = 0; - ourport->tx_mode = 0; - } - - if (ourport->rx_claimed) { - free_irq(ourport->rx_irq, ourport); - ourport->rx_claimed = 0; - ourport->rx_enabled = 0; - } - - if (ourport->dma) - s3c24xx_serial_release_dma(ourport); - - ourport->tx_in_progress = 0; -} - static void s3c64xx_serial_shutdown(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); @@ -1234,48 +1208,6 @@ static void apple_s5l_serial_shutdown(struct uart_port *port) ourport->tx_in_progress = 0; } -static int s3c24xx_serial_startup(struct uart_port *port) -{ - struct s3c24xx_uart_port *ourport = to_ourport(port); - int ret; - - ourport->rx_enabled = 1; - - ret = request_irq(ourport->rx_irq, s3c24xx_serial_rx_irq, 0, - s3c24xx_serial_portname(port), ourport); - - if (ret != 0) { - dev_err(port->dev, "cannot get irq %d\n", ourport->rx_irq); - return ret; - } - - ourport->rx_claimed = 1; - - dev_dbg(port->dev, "requesting tx irq...\n"); - - ourport->tx_enabled = 1; - - ret = request_irq(ourport->tx_irq, s3c24xx_serial_tx_irq, 0, - s3c24xx_serial_portname(port), ourport); - - if (ret) { - dev_err(port->dev, "cannot get irq %d\n", ourport->tx_irq); - goto err; - } - - ourport->tx_claimed = 1; - - /* the port reset code should have done the correct - * register setup for the port controls - */ - - return ret; - -err: - s3c24xx_serial_shutdown(port); - return ret; -} - static int s3c64xx_serial_startup(struct uart_port *port) { struct s3c24xx_uart_port *ourport = to_ourport(port); @@ -1692,8 +1624,6 @@ static const char *s3c24xx_serial_type(struct uart_port *port) const struct s3c24xx_uart_port *ourport = to_ourport(port); switch (ourport->info->type) { - case TYPE_S3C24XX: - return "S3C24XX"; case TYPE_S3C6400: return "S3C6400/10"; case TYPE_APPLE_S5L: @@ -1753,27 +1683,6 @@ static void s3c24xx_serial_put_poll_char(struct uart_port *port, unsigned char c); #endif -static const struct uart_ops s3c24xx_serial_ops = { - .pm = s3c24xx_serial_pm, - .tx_empty = s3c24xx_serial_tx_empty, - .get_mctrl = s3c24xx_serial_get_mctrl, - .set_mctrl = s3c24xx_serial_set_mctrl, - .stop_tx = s3c24xx_serial_stop_tx, - .start_tx = s3c24xx_serial_start_tx, - .stop_rx = s3c24xx_serial_stop_rx, - .break_ctl = s3c24xx_serial_break_ctl, - .startup = s3c24xx_serial_startup, - .shutdown = s3c24xx_serial_shutdown, - .set_termios = s3c24xx_serial_set_termios, - .type = s3c24xx_serial_type, - .config_port = s3c24xx_serial_config_port, - .verify_port = s3c24xx_serial_verify_port, -#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_CONSOLE_POLL) - .poll_get_char = s3c24xx_serial_get_poll_char, - .poll_put_char = s3c24xx_serial_put_poll_char, -#endif -}; - static const struct uart_ops s3c64xx_serial_ops = { .pm = s3c24xx_serial_pm, .tx_empty = s3c24xx_serial_tx_empty, @@ -1836,7 +1745,6 @@ static void s3c24xx_serial_init_port_default(int index) { port->iotype = UPIO_MEM; port->uartclk = 0; port->fifosize = 16; - port->ops = &s3c24xx_serial_ops; port->flags = UPF_BOOT_AUTOCONF; port->line = index; } @@ -1954,16 +1862,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, ourport->tx_irq = ret + 1; } - switch (ourport->info->type) { - case TYPE_S3C24XX: - ret = platform_get_irq(platdev, 1); - if (ret > 0) - ourport->tx_irq = ret; - break; - default: - break; - } - /* * DMA is currently supported only on DT platforms, if DMA properties * are specified. @@ -2083,9 +1981,6 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) &ourport->drv_data->def_cfg; switch (ourport->info->type) { - case TYPE_S3C24XX: - ourport->port.ops = &s3c24xx_serial_ops; - break; case TYPE_S3C6400: ourport->port.ops = &s3c64xx_serial_ops; break;