[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AEF12B7.3040704@atmel.com>
Date: Mon, 02 Nov 2009 18:11:19 +0100
From: Nicolas Ferre <nicolas.ferre@...el.com>
To: Ben Nizette <bn@...sdigital.com>,
Andrew Victor <avictor.za@...il.com>,
linux-arm-kernel@...ts.infradead.org
CC: "\"Thiago A.\" CorrĂȘa"
<thiago.correa@...il.com>, kernel@...32linux.org,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH 3/3 v2] at91/atmel-mci: inclusion of sd/mmc driver in
at91sam9g45 chip and board
Ben Nizette :
> On Wed, 2009-10-28 at 21:53 +0200, Andrew Victor wrote:
>> hi,
>>
>>> Then I think it would be best to use GPIO_PIN_NONE. Makes it clear
>>> what is expected and avoids confusion on what should be the proper
>>> value.
>>> I hope I'm not saying non-sense, but even if I am, I guess you can see
>>> that I'm advocating against the magic numbers :)
>> What magic numbers ?
>
> I think Thiago was referring to the "-1" in the original patch as the
> magic number.
>
> Leaving the field blank to be initialised to 0 is certainly the
> cleanest, I agree, but it doesn't actually /work/. On many archs 0 is a
> valid gpio number; the gpio_is_valid check used throughout the kernel
> (including atmel-mci.c) looks like
>
> static inline int gpio_is_valid(int number)
> {
> /* only some non-negative numbers are valid */
> return ((unsigned)number) < ARCH_NR_GPIOS;
> }
I understand that the better way to solve this issue is to:
- keep the AT91 way of specifying not connected pins (= 0)
- code the gpio_is_valid() function for at91 that tests this way of
handling not connected gpio
I see that in arch/arm/mach-at91/include/mach/gpio.h
we include the asm-generic/gpio.h file... must I implement the full set
of gpiolib ?
Best regards,
--
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists