Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Add the parent device (if present) to the device pr...



details:   https://anonhg.NetBSD.org/src/rev/cde327941e23
branches:  trunk
changeset: 341500:cde327941e23
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Nov 08 21:03:00 2015 +0000

description:
Add the parent device (if present) to the device properties, making it
easier to identify devices in the tree with drvctl(8).

diffstat:

 sys/kern/subr_autoconf.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r db73d788aead -r cde327941e23 sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Sun Nov 08 20:00:22 2015 +0000
+++ b/sys/kern/subr_autoconf.c  Sun Nov 08 21:03:00 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.235 2015/04/13 16:46:33 riastradh Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.236 2015/11/08 21:03:00 joerg 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.235 2015/04/13 16:46:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.236 2015/11/08 21:03:00 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1435,6 +1435,10 @@
            "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,
+                   "device-parent", device_xname(parent));
+       }
 
        if (dev->dv_cfdriver->cd_attrs != NULL)
                config_add_attrib_dict(dev);



Home | Main Index | Thread Index | Old Index