serial: ns16550: Reuse 48MHz default clock definition for non-DT OMAP boards
Subsystems (2)
PATCH 1/1 serial: ns16550: Reuse 48MHz default clock definition for non-DT OMAP boards
Signed-off-by Alexander Shiyan <[email protected]>
--- arch/arm/mach-omap/omap_devices.c | 8 +------- drivers/serial/serial_ns16550.c | 8 ++++---- 2 files changed, 5 insertions(+), 11 deletions(-)
arch/arm/mach-omap/omap_devices.c +1 -7
@@ -1,7 +1,6 @@// SPDX-License-Identifier: GPL-2.0-only #include <driver.h> -#include <platform_data/serial-ns16550.h> #include <asm/armlinux.h> #include <mach/omap3-devices.h>
@@ -16,15 +15,10 @@ void omap_add_sram0(resource_size_t base, resource_size_t size)add_mem_device ("sram0" , base, size,IORESOURCE_MEM_WRITEABLE ); } -static struct NS16550_plat serial_plat = { - .clock =48000000 ,/* 48MHz (APLL96/2) */ - .shift =2 , -}; -struct device_d *omap_add_uart (int id,unsigned long base) {return add_generic_device ("omap-uart" , id,NULL , base,1024 , -IORESOURCE_MEM |IORESOURCE_MEM_8BIT , &serial_plat); +IORESOURCE_MEM |IORESOURCE_MEM_8BIT ,NULL ); }#if defined(CONFIG_DRIVER_VIDEO_OMAP )
drivers/serial/serial_ns16550.c +4 -4
@@ -313,7 +313,7 @@ static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv)u32 offset;u32 width =1 ; -if (!IS_ENABLED (CONFIG_OFDEVICE )) +if (!IS_ENABLED (CONFIG_OFDEVICE ) || !np)return ;of_property_read_u32 (np,"clock-frequency" , &priv->plat.clock);
@@ -368,7 +368,7 @@ static __maybe_unused struct ns16550_drvdata omap_drvdata = { .linux_earlycon_name = "omap8250", }; -static __maybe_unused struct ns16550_drvdata am43xx_drvdata = { +static __maybe_unused struct ns16550_drvdata omap_clk48m_drvdata = { .init_port = ns16550_omap_init_port, .linux_console_name ="ttyO" , .clk_default =48000000 ,
@@ -561,7 +561,7 @@ static struct of_device_id ns16550_serial_dt_ids[] = { .data = &omap_drvdata, }, { .compatible = "ti,am4372-uart", - .data = &am43xx_drvdata, + .data = &omap_clk48m_drvdata, },#endif #if IS_ENABLED (CONFIG_MACH_MIPS_XBURST )
@@ -584,7 +584,7 @@ static struct of_device_id ns16550_serial_dt_ids[] = {static __maybe_unused struct platform_device_id ns16550_serial_ids[] = { { .name ="omap-uart" , - .driver_data = (unsigned long )&omap_drvdata, + .driver_data = (unsigned long )&omap_clk48m_drvdata, }, {/* sentinel */ },
base-commit: 18767e06f63166a0f1db0292ffaff5347c138d54
Signature · 1 line
2.32.0
Quoted 1 line · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>
Reviewed-by Ahmad Fatoum <[email protected]>
drivers/serial/serial_ns16550.c static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv) · line 316
Quoted 2 lines
drivers/serial/serial_ns16550.c +1
-1-if (!IS_ENABLED (CONFIG_OFDEVICE )) +if (!IS_ENABLED (CONFIG_OFDEVICE ) || !np)
Nitpick:
struct device_node *np = dev_of_node(dev);
if (!np)
is equivalent, but a bit less verbose.
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Quoted 10 lines · Ahmad Fatoum
Quoted 1 line · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>Reviewed-by Ahmad Fatoum <[email protected]>drivers/serial/serial_ns16550.c static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv) · line 316
Quoted 2 lines
drivers/serial/serial_ns16550.c +1
-1-if (!IS_ENABLED (CONFIG_OFDEVICE )) +if (!IS_ENABLED (CONFIG_OFDEVICE ) || !np)Nitpick:
Quoted 5 lines
struct device_node *np = dev_of_node(dev);if (!np)
is equivalent, but a bit less verbose.
Applied with this change, thanks
Sascha
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |