From owner-svn-src-stable@freebsd.org Wed Mar 14 03:47:59 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D459F4C6ED; Wed, 14 Mar 2018 03:47:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08F3E877D1; Wed, 14 Mar 2018 03:47:59 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCE1822D2A; Wed, 14 Mar 2018 03:47:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2E3lwtG051569; Wed, 14 Mar 2018 03:47:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2E3lwrg051568; Wed, 14 Mar 2018 03:47:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803140347.w2E3lwrg051568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 14 Mar 2018 03:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330905 - stable/11/sys/dev/ofw X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/dev/ofw X-SVN-Commit-Revision: 330905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 03:47:59 -0000 Author: kevans Date: Wed Mar 14 03:47:58 2018 New Revision: 330905 URL: https://svnweb.freebsd.org/changeset/base/330905 Log: MFC r327391: Avoid use of the fdt_get_property_*() API [It is] intrinsically incompatible with FDT versions < 16. This also simplifies the code a bit. Modified: stable/11/sys/dev/ofw/ofw_fdt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ofw/ofw_fdt.c ============================================================================== --- stable/11/sys/dev/ofw/ofw_fdt.c Wed Mar 14 03:45:33 2018 (r330904) +++ stable/11/sys/dev/ofw/ofw_fdt.c Wed Mar 14 03:47:58 2018 (r330905) @@ -227,7 +227,7 @@ ofw_fdt_instance_to_package(ofw_t ofw, ihandle_t insta static ssize_t ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const char *propname) { - const struct fdt_property *prop; + const void *prop; int offset, len; offset = fdt_phandle_offset(package); @@ -235,7 +235,7 @@ ofw_fdt_getproplen(ofw_t ofw, phandle_t package, const return (-1); len = -1; - prop = fdt_get_property(fdtp, offset, propname, &len); + prop = fdt_getprop(fdtp, offset, propname, &len); if (prop == NULL && strcmp(propname, "name") == 0) { /* Emulate the 'name' property */ @@ -312,7 +312,7 @@ static int ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, size_t size) { - const struct fdt_property *prop; + const void *prop; const char *name; int offset; @@ -327,7 +327,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const c if (previous != NULL) { while (offset >= 0) { - prop = fdt_get_property_by_offset(fdtp, offset, NULL); + prop = fdt_getprop_by_offset(fdtp, offset, &name, NULL); if (prop == NULL) return (-1); /* Internal error */ @@ -336,17 +336,16 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const c return (0); /* No more properties */ /* Check if the last one was the one we wanted */ - name = fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)); if (strcmp(name, previous) == 0) break; } } - prop = fdt_get_property_by_offset(fdtp, offset, &offset); + prop = fdt_getprop_by_offset(fdtp, offset, &name, &offset); if (prop == NULL) return (-1); /* Internal error */ - strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size); + strncpy(buf, name, size); return (1); }