From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B61D3E1729 for ; Thu, 9 Jul 2026 20:57:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783630631; cv=none; b=nhqljj9nEe+Wqkzg+BJqEcI84e8p46sw6UXSmOBfTvP98lr5SqMaGPhrJ/OHIqDd09WJg37L63V54qKR6ZqlWLQPqfpB8vp2V63Og2WvcEsASc7ayyb5iTFYDvvKSS92vOZOpKKhff5AMnysK+JoBx9rVYAv0WcDppPt/FZy2EQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783630631; c=relaxed/simple; bh=UOPWLLrKQJKvBsQKzVTiSHTFrQsDchtB/T3uQMykkS8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mv4m1k9/YvXOE+Cu9QgBKMHotLHyz9PCRag1tGYqUh7rRKTiGR5W9NqkC3BDuH5DjZ6C/xw5wxh7TVDI9CRAF5zC4364f/pAuSNZPnqNKVpT5tkWNg/NlvD81/NXPqY16xCEqWiL9ehY/EJjl3Cnb1cCuKU34M/wVgde0ePP2EY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MIiTkPd5; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MIiTkPd5" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-493b77b150aso1840205e9.2 for ; Thu, 09 Jul 2026 13:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783630628; x=1784235428; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=Z/ZeejehRBl9KeHPFOFStf/P5Levb0cXZN01ZYiLMbo=; b=MIiTkPd5zkXCC7biUgRXJt3z5vix61twjF9BX/eAJ797x/4wAH03wT3KdknN5QbuVx 8dAXsDKe7ncncSnuq6omEmau1bcmkd3cObzfjXAevS262BCQW0vvQB8xWC7aJemwlWkU 1tKnpTJdaPYSlguAOODw5c2uMLZ/QQGxNe+99agpOZXbxwS+a6WErxl5XwaOSUvTx5Pi s1LHVT+ZJPC0eDwJWjImTa1N3goRbMykwB1nK2J4e1fOMdCkHNKsDnqXWzHEEvZQbpg1 uuhhJCgz9EZ8Tr6iXqhb5aV3BTdhxNBeogD6n0VaaZ7N1STWVq8QHiGBZ+nzRC6wRUsm 7Y5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783630628; x=1784235428; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=Z/ZeejehRBl9KeHPFOFStf/P5Levb0cXZN01ZYiLMbo=; b=AjvGwXThuUfaT80TvnxisYYz7h7PKL4ti42x0fyw4CZ0VH+onDyv4sbTibitT47rbS l9KO4DvOgRadY9ggtqgFRfdyPOdQFuKVTN1kz75z5PSbcZtNijwXH5/fJU2MVtrEEz4s CPLWa7+qiO7KB6h5n9GyPrqZV2T8vcMGWNmWQmk1jeTULp+vaGyvnsXpNSikMUnhY+XE sfT+ZVT0WrOR4Ge/ukBddOFw97B/GIrX3gCO1qRdWE9SxIwCFmfy3ZByXWR+ZnTNk5NL 4Imd6JPgcqXzERcJ+yTJUsyb0X6gLwlOjxeX//SxacIB9vf9kH1LMUYOTOXpf/NSRNHt IAIQ== X-Forwarded-Encrypted: i=1; AHgh+RpasZ0W0c6LnkMVjYD77RX2W2xGLMpCRfGfKEmK/pmiGOkC9nHSrzbL8vUIchxVadFRT6p7YiwqtLlUKCY=@vger.kernel.org X-Gm-Message-State: AOJu0YwNW1kyUlYl009+MTiTIHZSGYQk8u7SEnsmlHnV9WY7nNAG+Qde oQ56/ArCh9Q9/c1WEAo6yzM0mcwgUcLuIwwC5KlI1tCqlLyNOY/iiIpa X-Gm-Gg: AfdE7cnuGKFEpI+PeU6FCD3aXJMML6o4E1SzlT3kmRc/pN6eaX5aqF92W5qU2QxlGTD I6F7L1KHU2aK9FxJCuH1aZGa6FVNsgAonmg7FedXzVF1tgq+yxEybL1BmslZMn8bCAL+69QAr3Q IcVsCznw3++xdFRwGn70vbOf2NvOKusUfhg85hsIKT0j2aAearM6nD/n3eEXVYD4jNAr018Gy6R hvmq1hc3cIPgexDLipq9Gi5k+WGoyj8c2p7m9Hy4LJpwT+BKlvog4NH5oU0KMXIIIsovicU5DMz mePE0yk5RWh39tI8s4qdvEoMLJ5KDrQ+SrmMeZ99QkvaUe/jwRp0OodL3fMyF1D1yhtAw8ota56 ECynw7Hoct3e4QIoQKyDb+1aFShvHVfYxu09ZKGNqbGVHk5+DKFuytAob26huumfRbZrQu269cF xa134vsPIaTw792DvGiydLTaK4jdbOBroBsGLdqk8byzuIkvpAb8qopuuWCZ5k/V7BICHmwQWvp 0b9lTY+ X-Received: by 2002:a05:600c:6289:b0:493:b647:1acd with SMTP id 5b1f17b1804b1-493e68dbd98mr85115815e9.36.1783630627912; Thu, 09 Jul 2026 13:57:07 -0700 (PDT) Received: from Ansuel-XPS24.localdomain (host-95-248-227-210.retail.telecomitalia.it. [95.248.227.210]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-47a9de1d910sm52894965f8f.6.2026.07.09.13.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 13:57:07 -0700 (PDT) From: Christian Marangi To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Christian Marangi , Andy Shevchenko , Benjamin Larsson , John Ogness , Marco Felsch , Gerhard Engleder , Jiaxun Yang , Randy Dunlap , Binbin Zhou , Rong Zhang , Lukas Wunner , Lubomir Rintel , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH 2/4] serial: 8250: export serial8250_get_baud_rate() Date: Thu, 9 Jul 2026 22:56:50 +0200 Message-ID: <20260709205656.319531-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260709205656.319531-1-ansuelsmth@gmail.com> References: <20260709205656.319531-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some driver might need to access the current baud rate to correctly configure it. Export the serial8250_get_baud_rate() function to limit code duplication. Signed-off-by: Christian Marangi --- drivers/tty/serial/8250/8250_port.c | 7 ++++--- include/linux/serial_8250.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 630deb7dd344..033d8fb8bb23 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2560,9 +2560,9 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud, serial8250_do_set_divisor(port, baud, quot); } -static unsigned int serial8250_get_baud_rate(struct uart_port *port, - struct ktermios *termios, - const struct ktermios *old) +unsigned int serial8250_get_baud_rate(struct uart_port *port, + struct ktermios *termios, + const struct ktermios *old) { unsigned int tolerance = port->uartclk / 100; unsigned int min; @@ -2589,6 +2589,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, */ return uart_get_baud_rate(port, termios, old, min, max); } +EXPORT_SYMBOL_GPL(serial8250_get_baud_rate); /* * Note in order to avoid the tty port mutex deadlock don't use the next method diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index a95b2d143d24..8d26fa2008b6 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -208,6 +208,10 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, int serial8250_console_setup(struct uart_port *port, char *options, bool probe); int serial8250_console_exit(struct uart_port *port); +unsigned int serial8250_get_baud_rate(struct uart_port *port, + struct ktermios *termios, + const struct ktermios *old); + void serial8250_set_isa_configurator(void (*v)(int port, struct uart_port *up, u32 *capabilities)); -- 2.53.0