Re: [PATCH 2/2] pinmux: Unify pin type from signed to unsigned.

From: Linus Walleij
Date: Fri Oct 28 2011 - 15:53:56 EST


On Thu, Oct 27, 2011 at 8:13 AM, Belisko Marek <marek.belisko@xxxxxxxxx> wrote:
> On Wed, Oct 26, 2011 at 11:06 PM, David Rientjes <rientjes@xxxxxxxxxx> wrote:
>> On Wed, 26 Oct 2011, Marek Belisko wrote:
>>
>>>  /* Sufficiently stupid default function when pinctrl is not in use */
>>> -static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
>>> +static inline bool pin_is_valid(struct pinctrl_dev *pctldev, unsigned int pin)
>>>  {
>>>       return pin >= 0;
>>>  }
>>
>>
>> So this would just become return true, right?
>
> Right I've overlooked it. Will send update version.

Well, actually the idea was that the external interface to the pin control
should have a signed value, so as to detect negative pin numbers as
"invalid".

Internally, and towards the pin control driver backends it is supposed
to be unsigned, because we don't want to have to check it for being
negative all the time.

So can you please make a patch only patching pin_desc_get()
to begin with?

For pin_is_valid() we rather should find out if it will have
any external users (like for GPIO) or if we should just delete
that function (now that pin control doesn't use it internally
anymore).

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/