From brix@drpepper.brixandersen.dk  Sun May 15 17:52:23 2011
Return-Path: <brix@drpepper.brixandersen.dk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3D86E1065673
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 May 2011 17:52:23 +0000 (UTC)
	(envelope-from brix@drpepper.brixandersen.dk)
Received: from solow.pil.dk (relay.pil.dk [195.41.47.164])
	by mx1.freebsd.org (Postfix) with ESMTP id 0377F8FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 May 2011 17:52:22 +0000 (UTC)
Received: from drpepper.brixandersen.dk (0x55534f5f.adsl.cybercity.dk [85.83.79.95])
	by solow.pil.dk (Postfix) with ESMTPA id EA15F1CC00D
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 15 May 2011 19:52:20 +0200 (CEST)
Received: by drpepper.brixandersen.dk (Postfix, from userid 1001)
	id 4CB951CC32; Sun, 15 May 2011 19:52:20 +0200 (CEST)
Message-Id: <20110515175220.4CB951CC32@drpepper.brixandersen.dk>
Date: Sun, 15 May 2011 19:52:20 +0200 (CEST)
From: Henrik Brix Andersen <brix@FreeBSD.org>
Reply-To: Henrik Brix Andersen <brix@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Improve API description in gpio_if.m
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         157070
>Category:       kern
>Synopsis:       [gpio] [patch] Improve API description in gpio_if.m
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gonzo
>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:  Tue May 24 03:06:10 UTC 2011
>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:
Responsible-Changed-From-To: freebsd-bugs->gonzo 
Responsible-Changed-By: brix 
Responsible-Changed-When: Sun May 22 20:24:11 UTC 2011 
Responsible-Changed-Why:  
Over to original author of gpio_if.m 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157070 
>Unformatted:
