Skip to contentSkip to conversation

tty: serial: atmel: Add COMMON_CLK dependency to SERIAL_ATMEL

PATCH In review Sergiu Moga 2 participants 2 messages Sep 26, 2022 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: atmel: Add COMMON_CLK dependency to SERIAL_ATMEL

Now that the driver makes use of __clk_is_enabled() in order to know whether a clk_disable_unprepare() is needed or not on the GCLK, a new dependency has been introduced: COMMON_CLK. If this CONFIG_COMMON_CLK is not enabled, whatever config may have this driver enabled without COMMON_CLK then an undefined reference to __clk_is_enabled() will be issued by the linker.

Thus, make sure that, unless CONFIG_COMMON_CLK is enabled, this driver is not compiled.

Fixes 5e3ce1f26129 ("tty: serial: atmel: Make the driver aware of the existence of GCLK")
---
 drivers/tty/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +1 -0
index a18dd525e42b..1aec3cf002f7 100644
@@ -127,6 +127,7 @@ config SERIAL_SB1250_DUART_CONSOLE
 
 config SERIAL_ATMEL
 	bool "AT91 on-chip serial port support"
+	depends on COMMON_CLK
 	depends on ARCH_AT91 || COMPILE_TEST
 	select SERIAL_CORE
 	select SERIAL_MCTRL_GPIO if GPIOLIB
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Sergiu Moga

Now that the driver makes use of __clk_is_enabled() in order to know whether a clk_disable_unprepare() is needed or not on the GCLK, a new dependency has been introduced: COMMON_CLK. If this CONFIG_COMMON_CLK is not enabled, whatever config may have this driver enabled without COMMON_CLK then an undefined reference to __clk_is_enabled() will be issued by the linker.

Quoted 6 lines

Thus, make sure that, unless CONFIG_COMMON_CLK is enabled, this driver is not compiled.

Fixes 5e3ce1f26129 ("tty: serial: atmel: Make the driver aware of the existence of GCLK")
Quoted 16 lines
---
  drivers/tty/serial/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +1 -0
index a18dd525e42b..1aec3cf002f7 100644
@@ -127,6 +127,7 @@ config SERIAL_SB1250_DUART_CONSOLE
 
  config SERIAL_ATMEL
  	bool "AT91 on-chip serial port support"
+	depends on COMMON_CLK
  	depends on ARCH_AT91 || COMPILE_TEST
  	select SERIAL_CORE
  	select SERIAL_MCTRL_GPIO if GPIOLIB
Signature · 1 line
Nicolas Ferre