Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2015 04:18:34 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285784 - head/sys/dev/gpio
Message-ID:  <201507220418.t6M4IYjD030083@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Wed Jul 22 04:18:33 2015
New Revision: 285784
URL: https://svnweb.freebsd.org/changeset/base/285784

Log:
  Cosmetic change.  When printing the child's mapped pins, use the plural
  only when necessary.
  
  Reported by:	Daniel O'Connor <darius@dons.net.au>,
  		Sulev-Madis Silber (ketas)

Modified:
  head/sys/dev/gpio/gpiobus.c

Modified: head/sys/dev/gpio/gpiobus.c
==============================================================================
--- head/sys/dev/gpio/gpiobus.c	Wed Jul 22 01:09:02 2015	(r285783)
+++ head/sys/dev/gpio/gpiobus.c	Wed Jul 22 04:18:33 2015	(r285784)
@@ -394,9 +394,14 @@ gpiobus_print_child(device_t dev, device
 	devi = GPIOBUS_IVAR(child);
 	memset(pins, 0, sizeof(pins));
 	retval += bus_print_child_header(dev, child);
-	retval += printf(" at pin(s) ");
-	gpiobus_print_pins(devi, pins, sizeof(pins));
-	retval += printf("%s", pins);
+	if (devi->npins > 0) {
+		if (devi->npins > 1)
+			retval += printf(" at pins ");
+		else
+			retval += printf(" at pin ");
+		gpiobus_print_pins(devi, pins, sizeof(pins));
+		retval += printf("%s", pins);
+	}
 	resource_list_print_type(&devi->rl, "irq", SYS_RES_IRQ, "%ld");
 	retval += bus_print_child_footer(dev, child);
 



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