Skip to contentSkip to conversation

mtd: rawnand: atmel: Add dependency on GENERIC_ALLOCATOR

PATCH In review Boris Brezillon 2 participants 3 messages Aug 11, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: rawnand: atmel: Add dependency on GENERIC_ALLOCATOR

The driver uses genalloc functions. Add a dependency on GENERIC_ALLOCATOR to prevent build errors when selected through COMPILE_TEST.

Fixes 88a40e7dca00 ("mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y")
---
 drivers/mtd/nand/raw/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +1 -1
index b6738ece16f1..0c3cc3e8e144 100644
@@ -278,7 +278,7 @@ config MTD_NAND_CS553X
 config MTD_NAND_ATMEL
 	tristate "Support for NAND Flash / SmartMedia on AT91"
 	depends on ARCH_AT91 || COMPILE_TEST
-	depends on HAS_IOMEM
+	depends on HAS_IOMEM && GENERIC_ALLOCATOR
 	select MFD_ATMEL_SMC
 	help
 	  Enables support for NAND Flash / Smart Media Card interface
Signature · 1 line
2.14.1
#1 lore raw

Hello,

Quoted 16 lines · Boris Brezillon

The driver uses genalloc functions. Add a dependency on GENERIC_ALLOCATOR to prevent build errors when selected through COMPILE_TEST.

Fixes 88a40e7dca00 ("mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y")
---
 drivers/mtd/nand/raw/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +0 -0
index b6738ece16f1..0c3cc3e8e144 100644

drivers/mtd/nand/raw/Kconfig config MTD_NAND_CS553X · line 281

Quoted 5 lines
drivers/mtd/nand/raw/Kconfig +1 -1
@@ -278,7 +278,7 @@ config MTD_NAND_CS553X
 config MTD_NAND_ATMEL
 	tristate "Support for NAND Flash / SmartMedia on AT91"
 	depends on ARCH_AT91 || COMPILE_TEST
-	depends on HAS_IOMEM
+	depends on HAS_IOMEM && GENERIC_ALLOCATOR

I think this kind of dependency should use a "select".

$ git grep "select.*GENERIC_ALLOCATOR" | wc -l
28
$ git grep "depends.*GENERIC_ALLOCATOR" | wc -l
1

It makes sense as it is a kind of "library" of functions, there's no reason for the user to be aware of this dependency. HAS_IOMEM is different, because it's a property of the architecture/platform.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 27 lines · On Sat, 11 Aug 2018 14:13:29 +0200 Thomas Petazzoni…

Hello,

Quoted 16 lines · Boris Brezillon

The driver uses genalloc functions. Add a dependency on GENERIC_ALLOCATOR to prevent build errors when selected through COMPILE_TEST.

Fixes 88a40e7dca00 ("mtd: rawnand: atmel: Allow selection of this driver when COMPILE_TEST=y")
---
 drivers/mtd/nand/raw/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/Kconfig +0 -0
index b6738ece16f1..0c3cc3e8e144 100644

drivers/mtd/nand/raw/Kconfig config MTD_NAND_CS553X · line 281

Quoted 5 lines
drivers/mtd/nand/raw/Kconfig +1 -1
@@ -278,7 +278,7 @@ config MTD_NAND_CS553X
 config MTD_NAND_ATMEL
 	tristate "Support for NAND Flash / SmartMedia on AT91"
 	depends on ARCH_AT91 || COMPILE_TEST
-	depends on HAS_IOMEM
+	depends on HAS_IOMEM && GENERIC_ALLOCATOR  

I think this kind of dependency should use a "select".

Quoted 8 lines
$ git grep "select.*GENERIC_ALLOCATOR" | wc -l
28
$ git grep "depends.*GENERIC_ALLOCATOR" | wc -l
1

It makes sense as it is a kind of "library" of functions, there's no reason for the user to be aware of this dependency. HAS_IOMEM is different, because it's a property of the architecture/platform.

Indeed. I always have a hard time choosing between 'select' and 'depends on'. Looks like I got it wrong this time too.