From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1foUHE-0004dE-MY for linux-mtd@lists.infradead.org; Sat, 11 Aug 2018 13:49:58 +0000 Date: Sat, 11 Aug 2018 15:49:30 +0200 From: Boris Brezillon To: Thomas Petazzoni Cc: Richard Weinberger , Miquel Raynal , linux-mtd@lists.infradead.org, Marek Vasut , Brian Norris , David Woodhouse , Randy Dunlap Subject: Re: [PATCH] mtd: rawnand: atmel: Add dependency on GENERIC_ALLOCATOR Message-ID: <20180811154930.4d3020a5@bbrezillon> In-Reply-To: <20180811141329.237ba017@windsurf> References: <20180811104022.23446-1-boris.brezillon@bootlin.com> <20180811141329.237ba017@windsurf> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, 11 Aug 2018 14:13:29 +0200 Thomas Petazzoni wrote: > Hello, > > On Sat, 11 Aug 2018 12:40:22 +0200, Boris Brezillon wrote: > > 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") > > Reported-by: Randy Dunlap > > Signed-off-by: Boris Brezillon > > --- > > drivers/mtd/nand/raw/Kconfig | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig > > index b6738ece16f1..0c3cc3e8e144 100644 > > --- a/drivers/mtd/nand/raw/Kconfig > > +++ b/drivers/mtd/nand/raw/Kconfig > > @@ -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. Indeed. I always have a hard time choosing between 'select' and 'depends on'. Looks like I got it wrong this time too.