Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 May 2011 19:52:20 +0200 (CEST)
From:      Henrik Brix Andersen <brix@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/157070: Improve API description in gpio_if.m
Message-ID:  <20110515175220.4CB951CC32@drpepper.brixandersen.dk>
Resent-Message-ID: <201105151800.p4FI0MdP092584@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help


>Number:         157070
>Category:       kern
>Synopsis:       Improve API description in gpio_if.m
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 15 18:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Henrik Brix Andersen
>Release:        FreeBSD 9.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD drpepper.brixandersen.dk 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r221961: Sun May 15 17:11:34 CEST 2011 root@drpepper.brixandersen.dk:/usr/obj/usr/home/brix/projects/freebsd/src/head/sys/GENERIC i386


	
>Description:
The API description for the GPIO_PIN_MAX() method is misleading.  The function should provide the maximum supported pin_num, not the total number of pins.

Most (if not all) in-tree GPIO drivers already name the second argument to this function 'maxpin', which seems less confusing.

>How-To-Repeat:
	
>Fix:
The following patch improves the API description and renames the second argument to better reflect the intent.

--- gpio_if.m.diff begins here ---
Index: sys/dev/gpio/gpio_if.m
===================================================================
--- sys/dev/gpio/gpio_if.m	(revision 221961)
+++ sys/dev/gpio/gpio_if.m	(working copy)
@@ -32,11 +32,11 @@
 INTERFACE gpio;
 
 #
-# Get total number of pins
+# Get the maximum pin_num
 #
 METHOD int pin_max {
 	device_t dev;
-	int *npins;
+	int *maxpin;
 };
 
 #
--- gpio_if.m.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110515175220.4CB951CC32>