From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Subject: [PATCH v1 1/7] serial: 8250_ni: Switch to use uart_read_port_properties()
Date: Fri, 21 Mar 2025 20:20:12 +0200 [thread overview]
Message-ID: <20250321182119.454507-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20250321182119.454507-1-andriy.shevchenko@linux.intel.com>
Since we have now a common helper to read port properties
use it instead of sparse home grown solution.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/8250/8250_ni.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c
index b10a42d2ad63..03e838f440be 100644
--- a/drivers/tty/serial/8250/8250_ni.c
+++ b/drivers/tty/serial/8250/8250_ni.c
@@ -285,7 +285,6 @@ static int ni16550_probe(struct platform_device *pdev)
const char *portmode;
bool rs232_property;
int ret;
- int irq;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data)
@@ -293,10 +292,6 @@ static int ni16550_probe(struct platform_device *pdev)
spin_lock_init(&uart.port.lock);
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return irq;
-
ret = ni16550_get_regs(pdev, &uart.port);
if (ret < 0)
return ret;
@@ -307,10 +302,7 @@ static int ni16550_probe(struct platform_device *pdev)
info = device_get_match_data(dev);
uart.port.dev = dev;
- uart.port.irq = irq;
- uart.port.irqflags = IRQF_SHARED;
- uart.port.flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF
- | UPF_FIXED_PORT | UPF_FIXED_TYPE;
+ uart.port.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_FIXED_TYPE;
uart.port.startup = ni16550_port_startup;
uart.port.shutdown = ni16550_port_shutdown;
@@ -332,12 +324,16 @@ static int ni16550_probe(struct platform_device *pdev)
/*
* Declaration of the base clock frequency can come from one of:
* - static declaration in this driver (for older ACPI IDs)
- * - a "clock-frquency" ACPI
+ * - a "clock-frequency" ACPI
*/
if (info->uartclk)
uart.port.uartclk = info->uartclk;
- if (device_property_read_u32(dev, "clock-frequency",
- &uart.port.uartclk)) {
+
+ ret = uart_read_port_properties(&uart.port);
+ if (ret)
+ return ret;
+
+ if (!uart.port.uartclk) {
data->clk = devm_clk_get_enabled(dev, NULL);
if (!IS_ERR(data->clk))
uart.port.uartclk = clk_get_rate(data->clk);
--
2.47.2
next prev parent reply other threads:[~2025-03-21 18:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 18:20 [PATCH v1 0/7] serial: 8250_ni: Clean up the driver Andy Shevchenko
2025-03-21 18:20 ` Andy Shevchenko [this message]
2025-03-21 18:20 ` [PATCH v1 2/7] serial: 8250_ni: Remove duplicate mapping Andy Shevchenko
2025-03-21 18:20 ` [PATCH v1 3/7] serial: 8250_ni: Switch to use platform_get_mem_or_io() Andy Shevchenko
2025-03-21 18:20 ` [PATCH v1 4/7] serial: 8250_ni: Remove unneeded conditionals Andy Shevchenko
2025-03-21 18:20 ` [PATCH v1 5/7] serial: 8250_ni: use serial_port_in()/serial_port_out() helpers Andy Shevchenko
2025-03-21 18:20 ` [PATCH v1 6/7] serial: 8250_ni: Switch to use dev_err_probe() Andy Shevchenko
2025-03-21 18:20 ` [PATCH v1 7/7] serial: 8250_ni: Tidy up ACPI ID table Andy Shevchenko
2025-03-24 22:10 ` [PATCH v1 0/7] serial: 8250_ni: Clean up the driver Chaitanya Vadrevu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250321182119.454507-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=chaitanya.vadrevu@emerson.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®