Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Mar 2018 03:41:07 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330902 - stable/11/sys/dev/ofw
Message-ID:  <201803140341.w2E3f7Kb048079@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Wed Mar 14 03:41:07 2018
New Revision: 330902
URL: https://svnweb.freebsd.org/changeset/base/330902

Log:
  MFC r322359: Enable OF_setprop API function to add property in FDT
  
  This patch modifies function ofw_fdt_setprop (called by OF_setprop),
  so that it can add property, when replacing is not possible.
  Adding property is needed to fixup FDT's that have missing
  properties.

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:39:31 2018	(r330901)
+++ stable/11/sys/dev/ofw/ofw_fdt.c	Wed Mar 14 03:41:07 2018	(r330902)
@@ -362,7 +362,11 @@ ofw_fdt_setprop(ofw_t ofw, phandle_t package, const ch
 	if (offset < 0)
 		return (-1);
 
-	return (fdt_setprop_inplace(fdtp, offset, propname, buf, len));
+	if (fdt_setprop_inplace(fdtp, offset, propname, buf, len) != 0)
+		/* Try to add property, when setting value inplace failed */
+		return (fdt_setprop(fdtp, offset, propname, buf, len));
+
+	return (0);
 }
 
 /* Convert a device specifier to a fully qualified pathname. */



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