fix proplib deprecation

This commit is contained in:
christos 2021-06-21 03:04:27 +00:00
parent 6b5045cd66
commit 3151045394
15 changed files with 54 additions and 54 deletions

View File

@ -266,7 +266,7 @@ libdm_task_get_name(libdm_task_t libdm_task)
{
char *name;
if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task,
if (!prop_dictionary_get_string(libdm_task->ldm_task,
DM_IOCTL_NAME, (const char **)&name))
return NULL;
@ -291,7 +291,7 @@ libdm_task_get_uuid(libdm_task_t libdm_task)
{
char *uuid;
if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task,
if (!prop_dictionary_get_string(libdm_task->ldm_task,
DM_IOCTL_UUID, (const char **)&uuid))
return NULL;
@ -304,7 +304,7 @@ libdm_task_get_command(libdm_task_t libdm_task)
{
char *command;
if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task,
if (!prop_dictionary_get_string(libdm_task->ldm_task,
DM_IOCTL_COMMAND, (const char **)&command))
return NULL;
@ -755,7 +755,7 @@ libdm_table_get_target(libdm_table_t libdm_table)
{
char *target;
if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_TYPE,
if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_TYPE,
(const char **)&target))
return NULL;
@ -782,7 +782,7 @@ libdm_table_get_params(libdm_table_t libdm_table)
{
char *params;
if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_PARAMS,
if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_PARAMS,
(const char **)&params))
return NULL;
@ -816,7 +816,7 @@ libdm_target_get_name(libdm_target_t libdm_target)
{
char *name;
if (!prop_dictionary_get_cstring_nocopy(libdm_target->ldm_trgt,
if (!prop_dictionary_get_string(libdm_target->ldm_trgt,
DM_TARGETS_NAME, (const char **)&name))
return NULL;
@ -860,7 +860,7 @@ libdm_dev_get_name(libdm_dev_t libdm_dev)
{
char *name;
if (!prop_dictionary_get_cstring_nocopy(libdm_dev->ldm_dev,
if (!prop_dictionary_get_string(libdm_dev->ldm_dev,
DM_DEV_NAME, (const char **)&name))
return NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: devpubd.c,v 1.6 2020/02/24 11:45:30 mlelstv Exp $ */
/* $NetBSD: devpubd.c,v 1.7 2021/06/21 03:14:12 christos Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2011-2015\
Jared D. McNeill <jmcneill@invisible.ca>. All rights reserved.");
__RCSID("$NetBSD: devpubd.c,v 1.6 2020/02/24 11:45:30 mlelstv Exp $");
__RCSID("$NetBSD: devpubd.c,v 1.7 2021/06/21 03:14:12 christos Exp $");
#include <sys/queue.h>
#include <sys/types.h>
@ -144,8 +144,8 @@ devpubd_eventloop(void)
res = prop_dictionary_recv_ioctl(drvctl_fd, DRVGETEVENT, &ev);
if (res)
err(EXIT_FAILURE, "DRVGETEVENT failed");
prop_dictionary_get_cstring_nocopy(ev, "event", &event);
prop_dictionary_get_cstring_nocopy(ev, "device", &device[0]);
prop_dictionary_get_string(ev, "event", &event);
prop_dictionary_get_string(ev, "device", &device[0]);
printf("%s: event='%s', device='%s'\n", __func__,
event, device[0]);

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $ */
/* $NetBSD: autoconf.c,v 1.14 2021/06/21 03:05:24 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2019/11/13 17:48:03 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.14 2021/06/21 03:05:24 christos Exp $");
#include "opt_md.h"
@ -227,7 +227,7 @@ device_register(device_t dev, void *aux)
*/
if (device_is_a(dev, "iic") &&
device_is_a(dev->dv_parent, "ziic")) {
(void)prop_dictionary_set_cstring_nocopy(device_properties(dev),
(void)prop_dictionary_set_string_nocopy(device_properties(dev),
I2C_PROP_INDIRECT_PROBE_STRATEGY, I2C_PROBE_STRATEGY_NONE);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: adm1021.c,v 1.28 2021/06/15 04:41:01 mlelstv Exp $ */
/* $NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $ */
/* $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $ */
/*
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.28 2021/06/15 04:41:01 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.29 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -409,11 +409,11 @@ admtemp_attach(device_t parent, device_t self, void *aux)
sc->sc_sensor[ADMTEMP_EXT].flags =
ENVSYS_FMONLIMITS | ENVSYS_FHAS_ENTROPY;
if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", &desc)) {
if (prop_dictionary_get_string(sc->sc_prop, "s00", &desc)) {
strncpy(iname, desc, 64);
}
if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s01", &desc)) {
if (prop_dictionary_get_string(sc->sc_prop, "s01", &desc)) {
strncpy(ename, desc, 64);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dbcool.c,v 1.61 2021/06/15 04:39:49 mlelstv Exp $ */
/* $NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.61 2021/06/15 04:39:49 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.62 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1697,7 +1697,7 @@ dbcool_attach_sensor(struct dbcool_softc *sc, int idx)
name_index = sc->sc_dc.dc_chip->table[idx].name_index;
snprintf(name, 7, "s%02x", sc->sc_dc.dc_chip->table[idx].reg.val_reg);
if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, name, &desc)) {
if (prop_dictionary_get_string(sc->sc_prop, name, &desc)) {
strlcpy(sc->sc_sensor[idx].desc, desc,
sizeof(sc->sc_sensor[idx].desc));
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: dstemp.c,v 1.13 2021/06/15 04:41:01 mlelstv Exp $ */
/* $NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $ */
/*-
* Copyright (c) 2018 Michael Lorenz
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.13 2021/06/15 04:41:01 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.14 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -126,9 +126,9 @@ dstemp_attach(device_t parent, device_t self, void *aux)
sc->sc_sensor_temp.state = ENVSYS_SINVALID;
sc->sc_sensor_temp.flags = ENVSYS_FHAS_ENTROPY;
if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", &desc)) {
if (prop_dictionary_get_string(sc->sc_prop, "s00", &desc)) {
strncpy(name, desc, 64);
} else if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "saa", &desc)) {
} else if (prop_dictionary_get_string(sc->sc_prop, "saa", &desc)) {
strncpy(name, desc, 64);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: i2c.c,v 1.78 2021/04/24 23:36:54 thorpej Exp $ */
/* $NetBSD: i2c.c,v 1.79 2021/06/21 03:12:54 christos Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.78 2021/04/24 23:36:54 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.79 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -452,7 +452,7 @@ iic_attach(device_t parent, device_t self, void *aux)
for (i = 0; i < count; i++) {
dev = prop_array_get(child_devices, i);
if (!dev) continue;
if (!prop_dictionary_get_cstring_nocopy(
if (!prop_dictionary_get_string(
dev, "name", &name)) {
/* "name" property is optional. */
name = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lm75.c,v 1.44 2021/06/13 09:46:04 mlelstv Exp $ */
/* $NetBSD: lm75.c,v 1.45 2021/06/21 03:12:54 christos Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.44 2021/06/13 09:46:04 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.45 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -290,7 +290,7 @@ lmtemp_attach(device_t parent, device_t self, void *aux)
ia->ia_name? ia->ia_name : device_xname(self),
sizeof(sc->sc_sensor.desc));
if (prop_dictionary_get_cstring_nocopy(sc->sc_prop, "s00", &desc)) {
if (prop_dictionary_get_string(sc->sc_prop, "s00", &desc)) {
strncpy(name, desc, 64);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcagpio.c,v 1.10 2021/01/27 02:29:48 thorpej Exp $ */
/* $NetBSD: pcagpio.c,v 1.11 2021/06/21 03:12:54 christos Exp $ */
/*-
* Copyright (c) 2020 Michael Lorenz
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcagpio.c,v 1.10 2021/01/27 02:29:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcagpio.c,v 1.11 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -191,7 +191,7 @@ pcagpio_attach(device_t parent, device_t self, void *aux)
for (i = 0; i < prop_array_count(pins); i++) {
nptr = NULL;
pin = prop_array_get(pins, i);
ok &= prop_dictionary_get_cstring_nocopy(pin, "name",
ok &= prop_dictionary_get_string(pin, "name",
&nptr);
ok &= prop_dictionary_get_uint32(pin, "pin", &num);
ok &= prop_dictionary_get_bool( pin, "active_high",

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcf8574.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $ */
/* $NetBSD: pcf8574.c,v 1.10 2021/06/21 03:12:54 christos Exp $ */
/*-
* Copyright (c) 2020 The NetBSD Foundation, Inc.
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcf8574.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcf8574.c,v 1.10 2021/06/21 03:12:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -175,7 +175,7 @@ pcf8574_attach(device_t parent, device_t self, void *aux)
for (i = 0; i < prop_array_count(pins); i++) {
pin = prop_array_get(pins, i);
ok &= prop_dictionary_get_cstring_nocopy(pin, "name", &nptr);
ok &= prop_dictionary_get_string(pin, "name", &nptr);
ok &= prop_dictionary_get_uint32(pin, "pin", &num);
ok &= prop_dictionary_get_bool(pin, "active_high", &act);
/* optional default state */

View File

@ -1,4 +1,4 @@
/* $NetBSD: veriexec.c,v 1.1 2015/12/09 18:25:32 maxv Exp $ */
/* $NetBSD: veriexec.c,v 1.2 2021/06/21 03:11:05 christos Exp $ */
/*-
* Copyright (c) 2005, 2006 Elad Efrat <elad@NetBSD.org>
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: veriexec.c,v 1.1 2015/12/09 18:25:32 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: veriexec.c,v 1.2 2021/06/21 03:11:05 christos Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@ -110,7 +110,7 @@ veriexec_delete(prop_dictionary_t dict, struct lwp *l)
const char *file;
int error;
if (!prop_dictionary_get_cstring_nocopy(dict, "file", &file))
if (!prop_dictionary_get_string(dict, "file", &file))
return (EINVAL);
error = namei_simple_kernel(file, NSM_FOLLOW_NOEMULROOT, &vp);
@ -135,7 +135,7 @@ veriexec_query(prop_dictionary_t dict, prop_dictionary_t rdict, struct lwp *l)
const char *file;
int error;
if (!prop_dictionary_get_cstring_nocopy(dict, "file", &file))
if (!prop_dictionary_get_string(dict, "file", &file))
return (EINVAL);
error = namei_simple_kernel(file, NSM_FOLLOW_NOEMULROOT, &vp);

View File

@ -1,4 +1,4 @@
/* $NetBSD: panic.c,v 1.1 2011/02/18 01:07:20 jmcneill Exp $ */
/* $NetBSD: panic.c,v 1.2 2021/06/21 03:08:07 christos Exp $ */
/*
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: panic.c,v 1.1 2011/02/18 01:07:20 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: panic.c,v 1.2 2021/06/21 03:08:07 christos Exp $");
#include <sys/module.h>
@ -63,7 +63,7 @@ panic_modcmd(modcmd_t cmd, void *opaque)
unsigned int i;
if (props)
prop_dictionary_get_cstring_nocopy(props, "how", &how);
prop_dictionary_get_string(props, "how", &how);
if (how == NULL)
how = "panic";

View File

@ -1,4 +1,4 @@
/* $NetBSD: drvctl.c,v 1.2 2010/09/02 02:17:35 jmcneill Exp $ */
/* $NetBSD: drvctl.c,v 1.3 2021/06/21 03:04:27 christos Exp $ */
/*
* Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca>
@ -64,9 +64,9 @@ drvctl_get_properties(int fd, const char *devnode, prop_dictionary_t *props)
command_dict = prop_dictionary_create();
args_dict = prop_dictionary_create();
prop_dictionary_set_cstring_nocopy(command_dict, "drvctl-command",
prop_dictionary_set_string_nocopy(command_dict, "drvctl-command",
"get-properties");
prop_dictionary_set_cstring_nocopy(args_dict, "device-name", devnode);
prop_dictionary_set_string_nocopy(args_dict, "device-name", devnode);
prop_dictionary_set(command_dict, "drvctl-arguments", args_dict);
prop_object_release(args_dict);
@ -115,7 +115,7 @@ drvctl_search(int fd, const char *curnode, const char *dvname,
rv = drvctl_get_properties(fd, laa.l_childname[i], &props);
if (rv == false || props == NULL)
continue;
rv = prop_dictionary_get_cstring_nocopy(props,
rv = prop_dictionary_get_string(props,
"device-driver", &curdvname);
if (rv == true && strcmp(curdvname, dvname) == 0) {
rv = prop_dictionary_get_uint32(props,

View File

@ -1,4 +1,4 @@
/* $NetBSD: graph.c,v 1.5 2020/06/15 13:06:39 sborrill Exp $ */
/* $NetBSD: graph.c,v 1.6 2021/06/21 03:09:52 christos Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support@precedence.co.uk>
@ -95,7 +95,7 @@ hdaudioctl_graph(int fd, int argc, char *argv[])
HDAUDIO_FGRP_WIDGET_INFO, &response);
if (error != 0)
break;
prop_dictionary_get_cstring_nocopy(response, "name", &name);
prop_dictionary_get_string(response, "name", &name);
prop_dictionary_get_uint32(response, "cap", &cap);
prop_dictionary_get_uint32(response, "config", &config);
prop_dictionary_get_uint8(response, "type", &type);
@ -174,7 +174,7 @@ next:
HDAUDIO_AFG_WIDGET_INFO, &response);
if (error != 0)
break;
prop_dictionary_get_cstring_nocopy(response, "name", &name);
prop_dictionary_get_string(response, "name", &name);
prop_dictionary_get_uint8(response, "type", &type);
prop_dictionary_get_uint8(response, "nid", &nid);
@ -197,7 +197,7 @@ next:
HDAUDIO_AFG_WIDGET_INFO, &response);
if (error != 0)
break;
prop_dictionary_get_cstring_nocopy(response, "name", &name);
prop_dictionary_get_string(response, "name", &name);
prop_dictionary_get_uint8(response, "type", &type);
prop_dictionary_get_uint8(response, "nid", &nid);

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdaudioctl.c,v 1.5 2020/07/01 12:19:45 sborrill Exp $ */
/* $NetBSD: hdaudioctl.c,v 1.6 2021/06/21 03:09:52 christos Exp $ */
/*
* Copyright (c) 2009 Precedence Technologies Ltd <support@precedence.co.uk>
@ -141,7 +141,7 @@ hdaudioctl_list(int fd)
prop_dictionary_get_uint16(dict, "vendor-id", &vendor);
prop_dictionary_get_uint16(dict, "product-id", &product);
prop_dictionary_get_uint32(dict, "subsystem-id", &subsystem);
prop_dictionary_get_cstring_nocopy(dict, "device", &device);
prop_dictionary_get_string(dict, "device", &device);
printf("codecid 0x%02X nid 0x%02X vendor 0x%04X "
"product 0x%04X subsystem 0x%08X device %s\n",