prop_dictionary_[sg]et_cstring{,_nocopy} -> prop_dictionary_[sg]et_string{,_nocopy}

This commit is contained in:
jmcneill 2020-06-27 13:53:10 +00:00
parent e08bb185ae
commit 85f05b7aa3

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_autoconf.c,v 1.271 2020/05/25 21:05:01 thorpej Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.272 2020/06/27 13:53:10 jmcneill Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.271 2020/05/25 21:05:01 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.272 2020/06/27 13:53:10 jmcneill Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@ -568,13 +568,13 @@ devmon_report_device(device_t dev, bool isattach)
what = (isattach ? "device-attach" : "device-detach");
parent = (pdev == NULL ? "root" : device_xname(pdev));
if (prop_dictionary_get_cstring_nocopy(dict, "location", &where)) {
prop_dictionary_set_cstring(ev, "location", where);
if (prop_dictionary_get_string(dict, "location", &where)) {
prop_dictionary_set_string(ev, "location", where);
aprint_debug("ev: %s %s at %s in [%s]\n",
what, device_xname(dev), parent, where);
}
if (!prop_dictionary_set_cstring(ev, "device", device_xname(dev)) ||
!prop_dictionary_set_cstring(ev, "parent", parent)) {
if (!prop_dictionary_set_string(ev, "device", device_xname(dev)) ||
!prop_dictionary_set_string(ev, "parent", parent)) {
prop_object_release(ev);
return;
}
@ -1454,12 +1454,12 @@ config_devalloc(const device_t parent, const cfdata_t cf, const int *locs)
dev->dv_properties = prop_dictionary_create();
KASSERT(dev->dv_properties != NULL);
prop_dictionary_set_cstring_nocopy(dev->dv_properties,
prop_dictionary_set_string_nocopy(dev->dv_properties,
"device-driver", dev->dv_cfdriver->cd_name);
prop_dictionary_set_uint16(dev->dv_properties,
"device-unit", dev->dv_unit);
if (parent != NULL) {
prop_dictionary_set_cstring(dev->dv_properties,
prop_dictionary_set_string(dev->dv_properties,
"device-parent", device_xname(parent));
}
@ -1513,7 +1513,7 @@ config_add_attrib_dict(device_t dev)
break;
if ((attr_dict = prop_dictionary_create()) == NULL)
break;
prop_dictionary_set_cstring_nocopy(attr_dict, "attribute-name",
prop_dictionary_set_string_nocopy(attr_dict, "attribute-name",
ci->ci_name);
/* Create an array of the locator names and defaults */
@ -1524,10 +1524,10 @@ config_add_attrib_dict(device_t dev)
loc_dict = prop_dictionary_create();
if (loc_dict == NULL)
continue;
prop_dictionary_set_cstring_nocopy(loc_dict,
prop_dictionary_set_string_nocopy(loc_dict,
"loc-name", ci->ci_locdesc[j].cld_name);
if (ci->ci_locdesc[j].cld_defaultstr != NULL)
prop_dictionary_set_cstring_nocopy(
prop_dictionary_set_string_nocopy(
loc_dict, "default",
ci->ci_locdesc[j].cld_defaultstr);
prop_array_set(loc_array, j, loc_dict);