Re: [PATCH 21/22] mtd: cs553x: Fix dependencies for !HAS_IOMEM archs

From: Richard Weinberger
Date: Tue Jan 26 2016 - 08:58:33 EST


Geert,

Am 26.01.2016 um 12:00 schrieb Geert Uytterhoeven:
> Hi Richard,
>
> On Mon, Jan 25, 2016 at 11:24 PM, Richard Weinberger <richard@xxxxxx> wrote:
>> Not every arch has io memory nor can this driver ever work
>> on UML/i386.
>> So, unbreak the build by fixing the dependencies.
>>
>> Signed-off-by: Richard Weinberger <richard@xxxxxx>
>> ---
>> drivers/mtd/nand/Kconfig | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
>> index 545d82b..b253654 100644
>> --- a/drivers/mtd/nand/Kconfig
>> +++ b/drivers/mtd/nand/Kconfig
>> @@ -311,6 +311,7 @@ config MTD_NAND_CAFE
>> config MTD_NAND_CS553X
>> tristate "NAND support for CS5535/CS5536 (AMD Geode companion chip)"
>> depends on X86_32
>> + depends on !UML && HAS_IOMEM
>
> I don't think there's a need for the !UML dependency?
> Hence just "depends on X86_32 && HAS_IOMEM"?

Strictly speaking this would work as HAS_IOMEM implies !UML.
The build error shows that it fails also because UML/i386 is x86_32
but lacks some x86_32 stuff:

drivers/mtd/nand/cs553x_nand.c: In function âcs553x_init_oneâ:
drivers/mtd/nand/cs553x_nand.c:212:2: error: implicit declaration of function âioremapâ [-Werror=implicit-function-declaration]
this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096);
^
drivers/mtd/nand/cs553x_nand.c:212:36: warning: assignment makes pointer from integer without a cast [enabled by default]
this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096);
^
drivers/mtd/nand/cs553x_nand.c:256:2: error: implicit declaration of function âiounmapâ [-Werror=implicit-function-declaration]
iounmap(this->IO_ADDR_R);
^
drivers/mtd/nand/cs553x_nand.c: In function âis_geodeâ:
drivers/mtd/nand/cs553x_nand.c:266:19: error: âstruct cpuinfo_umâ has no member named âx86_vendorâ
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
^
drivers/mtd/nand/cs553x_nand.c:266:34: error: âX86_VENDOR_AMDâ undeclared (first use in this function)
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
^
drivers/mtd/nand/cs553x_nand.c:266:34: note: each undeclared identifier is reported only once for each function it appears in
drivers/mtd/nand/cs553x_nand.c:267:19: error: âstruct cpuinfo_umâ has no member named âx86â
boot_cpu_data.x86 == 5 &&
^
drivers/mtd/nand/cs553x_nand.c:268:19: error: âstruct cpuinfo_umâ has no member named âx86_modelâ
boot_cpu_data.x86_model == 10)
^
drivers/mtd/nand/cs553x_nand.c:271:20: error: âstruct cpuinfo_umâ has no member named âx86_vendorâ
if ((boot_cpu_data.x86_vendor == X86_VENDOR_NSC ||
^
drivers/mtd/nand/cs553x_nand.c:271:35: error: âX86_VENDOR_NSCâ undeclared (first use in this function)
if ((boot_cpu_data.x86_vendor == X86_VENDOR_NSC ||
^
drivers/mtd/nand/cs553x_nand.c:272:20: error: âstruct cpuinfo_umâ has no member named âx86_vendorâ
boot_cpu_data.x86_vendor == X86_VENDOR_CYRIX) &&
^
drivers/mtd/nand/cs553x_nand.c:272:35: error: âX86_VENDOR_CYRIXâ undeclared (first use in this function)
boot_cpu_data.x86_vendor == X86_VENDOR_CYRIX) &&
^
drivers/mtd/nand/cs553x_nand.c:273:19: error: âstruct cpuinfo_umâ has no member named âx86â
boot_cpu_data.x86 == 5 &&
^
drivers/mtd/nand/cs553x_nand.c:274:19: error: âstruct cpuinfo_umâ has no member named âx86_modelâ
boot_cpu_data.x86_model == 5)

Maybe a "depends on X86_32 && !UML" would make more sense. hmm?

Thanks,
//richard