Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2013 21:01:28 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259199 - head/sys/dev/ofw
Message-ID:  <201312102101.rBAL1SN1019553@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Tue Dec 10 21:01:28 2013
New Revision: 259199
URL: http://svnweb.freebsd.org/changeset/base/259199

Log:
  Return the correct IEEE 1275 code for "nextprop".

Modified:
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/ofw/ofw_fdt.c
==============================================================================
--- head/sys/dev/ofw/ofw_fdt.c	Tue Dec 10 20:52:31 2013	(r259198)
+++ head/sys/dev/ofw/ofw_fdt.c	Tue Dec 10 21:01:28 2013	(r259199)
@@ -267,8 +267,10 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac
 }
 
 /*
- * Get the next property of a package. Return the actual len of retrieved
- * prop name.
+ * Get the next property of a package. Return values:
+ *  -1: package or previous property does not exist
+ *   0: no more properties
+ *   1: success
  */
 static int
 ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf,
@@ -310,7 +312,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa
 
 	strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size);
 
-	return (strlen(buf));
+	return (1);
 }
 
 /* Set the value of a property of a package. */



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