tty: serial: meson: Fix the compile link error reported by kernel test robot
Subsystems (2)
PATCH v2 1/1 tty: serial: meson: Fix the compile link error reported by kernel test robot
Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.
--- drivers/tty/serial/Kconfig | 1 + drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 11 deletions(-)
drivers/tty/serial/Kconfig +1 -0
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI config SERIAL_MESON tristate "Meson serial port support" depends on ARCH_MESON || COMPILE_TEST + depends on COMMON_CLK select SERIAL_CORE help This enables the driver for the on-chip UARTs of the Amlogic
drivers/tty/serial/meson_uart.c +26 -11
@@ -780,28 +780,37 @@ static int meson_uart_probe(struct platform_device *pdev)return ret; irq =platform_get_irq (pdev,0 ); -if (irq <0 ) -return irq; +if (irq <0 ) { + ret = irq; + goto err_out_clk_disable; + }of_property_read_u32 (pdev->dev.of_node,"fifo-size" , &fifosize);if (meson_ports[pdev->id]) {dev_err (&pdev->dev,"port %d already allocated\n" , pdev->id); -return -EBUSY ; + ret = -EBUSY ; + goto err_out_clk_disable; } port =devm_kzalloc (&pdev->dev,sizeof (struct uart_port ),GFP_KERNEL ); -if (!port) -return -ENOMEM ; +if (!port) { + ret = -ENOMEM ; + goto err_out_clk_disable; + } port->membase =devm_ioremap_resource (&pdev->dev, res_mem); -if (IS_ERR (port->membase)) -return PTR_ERR (port->membase); +if (IS_ERR (port->membase)) { + ret =PTR_ERR (port->membase); + goto err_out_clk_disable; + } private_data =devm_kzalloc (&pdev->dev,sizeof (*private_data),GFP_KERNEL ); -if (!private_data) -return -ENOMEM ; +if (!private_data) { + ret = -ENOMEM ; + goto err_out_clk_disable; + }if (device_get_match_data (&pdev->dev)) private_data->use_xtal_clk = true;
@@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device *pdev) ret =meson_uart_probe_clocks (port);if (ret) -return ret; + goto err_out_clk_disable; meson_ports[pdev->id] = port;platform_set_drvdata (pdev, port);
@@ -831,9 +840,15 @@ static int meson_uart_probe(struct platform_device *pdev)meson_uart_reset (port); ret =uart_add_one_port (&meson_uart_driver, port); -if (ret) +if (ret) { meson_ports[pdev->id] =NULL ; + goto err_out_clk_disable; + } + +return 0 ; +err_out_clk_disable: +clk_disable_unprepare (pclk);return ret; }
base-commit: c2faf737abfb10f88f2d2612d573e9edc3c42c37
Signature · 1 line
2.33.1
i,
Quoted 5 lines · Yu Tu
Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in
Kconfigkernel test Robot compilation error due toCOMMON_CLKdependency.Fixes 44023b8e1f14 ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)
AFAIK this commit is not in an uptream/feature branch, so you should simply fix your Use CCF to describe the UART baud rate clock instead.
Neil
Quoted 99 lines
Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Yu Tu <[email protected]>--- drivers/tty/serial/Kconfig | 1 + drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 11 deletions(-)drivers/tty/serial/Kconfig +1
-0@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI config SERIAL_MESON tristate "Meson serial port support" depends on ARCH_MESON || COMPILE_TEST + depends on COMMON_CLK select SERIAL_CORE help This enables the driver for the on-chip UARTs of the Amlogicdrivers/tty/serial/meson_uart.c +26
-11@@ -780,28 +780,37 @@ static int meson_uart_probe(struct platform_device *pdev)return ret; irq =platform_get_irq (pdev,0 ); -if (irq <0 ) -return irq; +if (irq <0 ) { + ret = irq; + goto err_out_clk_disable; + }of_property_read_u32 (pdev->dev.of_node,"fifo-size" , &fifosize);if (meson_ports[pdev->id]) {dev_err (&pdev->dev,"port %d already allocated\n" , pdev->id); -return -EBUSY ; + ret = -EBUSY ; + goto err_out_clk_disable; } port =devm_kzalloc (&pdev->dev,sizeof (struct uart_port ),GFP_KERNEL ); -if (!port) -return -ENOMEM ; +if (!port) { + ret = -ENOMEM ; + goto err_out_clk_disable; + } port->membase =devm_ioremap_resource (&pdev->dev, res_mem); -if (IS_ERR (port->membase)) -return PTR_ERR (port->membase); +if (IS_ERR (port->membase)) { + ret =PTR_ERR (port->membase); + goto err_out_clk_disable; + } private_data =devm_kzalloc (&pdev->dev,sizeof (*private_data),GFP_KERNEL ); -if (!private_data) -return -ENOMEM ; +if (!private_data) { + ret = -ENOMEM ; + goto err_out_clk_disable; + }if (device_get_match_data (&pdev->dev)) private_data->use_xtal_clk = true;@@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device *pdev) ret =meson_uart_probe_clocks (port);if (ret) -return ret; + goto err_out_clk_disable; meson_ports[pdev->id] = port;platform_set_drvdata (pdev, port);@@ -831,9 +840,15 @@ static int meson_uart_probe(struct platform_device *pdev)meson_uart_reset (port); ret =uart_add_one_port (&meson_uart_driver, port); -if (ret) +if (ret) { meson_ports[pdev->id] =NULL ; + goto err_out_clk_disable; + } + +return 0 ; +err_out_clk_disable: +clk_disable_unprepare (pclk);return ret; }base-commit:
c2faf737abfb10f88f2d2612d573e9edc3c42c37
Hi Neil,
Thank you very much for your reply.
Quoted 4 lines · Neil Armstrong
[ EXTERNAL EMAIL ]
i,
Quoted 9 lines
Quoted 5 lines · Yu Tu
Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in
Kconfigkernel test Robot compilation error due toCOMMON_CLKdependency.Fixes 44023b8e1f14 ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)AFAIK this commit is not in an uptream/feature branch, so you should simply fix your
Use CCF to describe the UART baud rate clockinstead.
I'll correct it right away as you suggested.
Quoted 93 lines
Neil
Quoted 90 lines
Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Yu Tu <[email protected]>---
drivers/tty/serial/Kconfig | 1 +drivers/tty/serial/meson_uart.c| 37 +++++++++++++++++++++++----------2 files changed, 27 insertions(+), 11 deletions(-)drivers/tty/serial/Kconfig +0
-0@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMIconfig
SERIAL_MESON
tristate "Meson serial port support"
depends onARCH_MESON||COMPILE_TEST
+ depends onCOMMON_CLK
selectSERIAL_CORE
help
This enables the driver for the on-chip UARTs of the Amlogicdrivers/tty/serial/meson_uart.c +26
-11@@ -780,28 +780,37 @@ static int meson_uart_probe(struct platform_device *pdev) return ret; irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto err_out_clk_disable; + } of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize); if (meson_ports[pdev->id]) { dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); - return -EBUSY; + ret = -EBUSY; + goto err_out_clk_disable; } port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL); - if (!port) - return -ENOMEM; + if (!port) { + ret = -ENOMEM; + goto err_out_clk_disable; + } port->membase = devm_ioremap_resource(&pdev->dev, res_mem); - if (IS_ERR(port->membase)) - return PTR_ERR(port->membase); + if (IS_ERR(port->membase)) { + ret = PTR_ERR(port->membase); + goto err_out_clk_disable; + } private_data = devm_kzalloc(&pdev->dev, sizeof(*private_data), GFP_KERNEL); - if (!private_data) - return -ENOMEM; + if (!private_data) { + ret = -ENOMEM; + goto err_out_clk_disable; + } if (device_get_match_data(&pdev->dev)) private_data->use_xtal_clk = true;@@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device *pdev) ret = meson_uart_probe_clocks(port); if (ret) - return ret; + goto err_out_clk_disable; meson_ports[pdev->id] = port; platform_set_drvdata(pdev, port);@@ -831,9 +840,15 @@ static int meson_uart_probe(struct platform_device *pdev) meson_uart_reset(port); ret = uart_add_one_port(&meson_uart_driver, port); - if (ret) + if (ret) { meson_ports[pdev->id] = NULL; + goto err_out_clk_disable; + } + + return 0; +err_out_clk_disable: + clk_disable_unprepare(pclk); return ret; }base-commit:
c2faf737abfb10f88f2d2612d573e9edc3c42c37
Greg Kroah-Hartman
maintainerQuoted 10 lines · Neil Armstrong
i,
Quoted 5 lines · Yu Tu
Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in
Kconfigkernel test Robot compilation error due toCOMMON_CLKdependency.Fixes 44023b8e1f14 ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)AFAIK this commit is not in an uptream/feature branch, so you should simply fix your
Use CCF to describe the UART baud rate clockinstead.
This commit is in my tree and in linux-next, it is correctly listed here.
thanks,
greg k-h