[U-Boot] [PATCH] M28: GPIO pin validity check added

Mike Frysinger vapier at gentoo.org
Wed Nov 23 23:38:40 CET 2011


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: <http://lists.denx.de/pipermail/u-boot/attachments/20111123/e98e1185/attachment.pgp>


More information about the U-Boot mailing list