From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] at91: at91-ohci: fix set/get power
Date: Mon, 14 Nov 2011 21:51:29 +0100 [thread overview]
Message-ID: <20111114215129.783f4ab3@skate> (raw)
In-Reply-To: <CAFumwP08OeGqrNrTAzYeLkB=oZtyMDEoBa9epoHcG_Wjc5CQ8g@mail.gmail.com>
Le Mon, 14 Nov 2011 22:39:21 +0200,
Andrew Victor <avictor.za@gmail.com> a ?crit :
> Shouldn't that rather be:
> if (!gpio_is_valid(pdata->vbus_pin[port]))
> return;
No, because gpio_is_valid() accept 0 as a valid GPIO. Therefore, when
you don't set anything for the .vbus_pin field, the values are zero,
and gpio_is_valid() will tell you that it's a valid GPIO. If we wanted
to use gpio_is_valid(), we would have to do something like .vbus_pin =
{ -EINVAL, -EINVAL } in every board for which the vbus pin isn't used.
It's a quite unfortunate behaviour of the current gpio subsystem.
Regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2011-11-14 20:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-12 15:46 [PATCH] at91: at91-ohci: fix set/get power Jean-Christophe PLAGNIOL-VILLARD
2011-11-14 10:57 ` Nicolas Ferre
2011-11-14 18:22 ` Thomas Petazzoni
2011-11-14 20:39 ` Andrew Victor
2011-11-14 20:51 ` Thomas Petazzoni [this message]
2011-11-15 0:59 ` Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111114215129.783f4ab3@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.