git: 7030980bc9aa - main - bus: improve null_add_child() panic message

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 20 Dec 2024 07:18:09 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=7030980bc9aa62aaf25ffab44e24af854c57a9b1

commit 7030980bc9aa62aaf25ffab44e24af854c57a9b1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-12-18 21:29:10 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-12-20 07:16:04 +0000

    bus: improve null_add_child() panic message
    
    When null_add_child() panics add the bus device name/unit and the new
    unit as this will immediately reveal the parent missing the
      DEVMETHOD(bus_add_child, ...)
    entry.
    
    Reviewed by:    imp
    Differential Revision: https://reviews.freebsd.org/D48151
---
 sys/kern/bus_if.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index e42dc6d31441..74114ff7baee 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -63,7 +63,8 @@ CODE {
 	    int unit)
 	{
 
-		panic("bus_add_child is not implemented");
+		panic("%s: bus_add_child is not implemented, name '%s', "
+		    "unit %d", device_get_nameunit(bus), name, unit);
 	}
 
 	static int