Skip to contentSkip to conversation

nvmem: fix Kconfig dependency of the Atmel I2C helper

PATCH New Alexander Shiyan 1 participant 1 message Dec 1 NVMEM framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmem: fix Kconfig dependency of the Atmel I2C helper

commit 0837819622a2 ("nvmem: add support for Atmel sha204(a)") adds NVMEM_ATMEL_I2C for atmel-i2c.o, which uses both crc16() and bitrev16(), but selects them in the wrong symbol: NVMEM_ATMEL_SHA204A selects CRC16 and BITREV while NVMEM_ATMEL_I2C selects BITREVERSE, a symbol that does not exist in barebox.

Kconfig silently treats an unknown symbol as n, so the dead select is a no-op. The dependencies only work today because the sole user, NVMEM_ATMEL_SHA204A, selects CRC16 and BITREV itself; any other user of NVMEM_ATMEL_I2C would fail to link.

Move CRC16 and BITREV to NVMEM_ATMEL_I2C, which is the symbol that builds atmel-i2c.o, and drop the non-existent BITREVERSE.

Fixes 0837819622a2 ("nvmem: add support for Atmel sha204(a)")
---
 drivers/nvmem/Kconfig | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/nvmem/Kconfig +2 -3
index b7501798cb..f251e22a5d 100644
@@ -117,8 +117,6 @@ config STARFIVE_OTP
 config NVMEM_ATMEL_SHA204A
 	bool "Support for Microchip / Atmel SHA accelerator OTP support"
 	depends on I2C
-	select CRC16
-	select BITREV
 	select NVMEM_ATMEL_I2C
 	help
 	  Microchip / Atmel SHA accelerator and RNG.
@@ -127,7 +125,8 @@ config NVMEM_ATMEL_SHA204A
 
 config NVMEM_ATMEL_I2C
 	bool
-	select BITREVERSE
+	select CRC16
+	select BITREV
 
 config TI_K3_OTP
 	bool "TI K3 OTP"
Signature · 1 line
2.54.0