diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2025-03-21 21:20:15 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-11 17:51:19 +0300 |
| commit | 38dbd9517d5872b2cafb576656fb214b48b1e893 (patch) | |
| tree | 284935e8a23f31828b5990a3480919386ce069fb | |
| parent | b4694a76180b71cc4040c3c9ab75ea0058b6cc3a (diff) | |
| download | linux-38dbd9517d5872b2cafb576656fb214b48b1e893.tar.xz | |
serial: 8250_ni: Remove unneeded conditionals
It doesn't matter if the properties are supplied or not in
the struct ni16550_device_info as default in any case is 0.
Hence there is no need to check for them being set.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com>
Reviewed-by: Chaitanya Vadrevu <chaitanya.vadrevu@emerson.com>
Link: https://lore.kernel.org/r/20250321182119.454507-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/tty/serial/8250/8250_ni.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c index 2dc510c0a5ef..8bb8bb7bb4f2 100644 --- a/drivers/tty/serial/8250/8250_ni.c +++ b/drivers/tty/serial/8250/8250_ni.c @@ -275,7 +275,7 @@ static int ni16550_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct uart_8250_port uart = {}; unsigned int txfifosz, rxfifosz; - unsigned int prescaler = 0; + unsigned int prescaler; struct ni16550_data *data; const char *portmode; bool rs232_property; @@ -321,8 +321,7 @@ static int ni16550_probe(struct platform_device *pdev) * - static declaration in this driver (for older ACPI IDs) * - a "clock-frequency" ACPI */ - if (info->uartclk) - uart.port.uartclk = info->uartclk; + uart.port.uartclk = info->uartclk; ret = uart_read_port_properties(&uart.port); if (ret) @@ -340,11 +339,9 @@ static int ni16550_probe(struct platform_device *pdev) goto err; } - if (info->prescaler) - prescaler = info->prescaler; + prescaler = info->prescaler; device_property_read_u32(dev, "clock-prescaler", &prescaler); - - if (prescaler != 0) { + if (prescaler) { uart.port.set_mctrl = ni16550_set_mctrl; ni16550_config_prescaler(&uart, (u8)prescaler); } |
