From: Mike Frysinger Date: Wed, 23 Nov 2011 17:38:40 -0500 Subject: [U-Boot] [PATCH] M28: GPIO pin validity check added In-Reply-To: <2A9FB46C-1E1C-4127-9636-8E83FBE93ED7@Delien.nl> References: <2A9FB46C-1E1C-4127-9636-8E83FBE93ED7@Delien.nl> Message-ID: <201111231738.40799.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 23 November 2011 10:08:58 Robert Deli?n wrote: > +extern int gpio_invalid(int gp); if you really want to add this function, the Linux GPIO API uses: bool gpio_is_valid(int number); but that doesn't negate the gpio_request() func from having to validate the pin given to it, so i don't see much point in providing this at this time ... no code should do something like: if (!gpio_is_valid()) return error; if (gpio_request()) return error; -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: