The branch main has been updated by wulf:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=149b9f26d0bab5864f484b52066f9b0ffb06939c

commit 149b9f26d0bab5864f484b52066f9b0ffb06939c
Author:     Vladimir Kondratyev <w...@freebsd.org>
AuthorDate: 2025-08-17 21:00:44 +0000
Commit:     Vladimir Kondratyev <w...@freebsd.org>
CommitDate: 2025-08-17 21:00:44 +0000

    hidraw(4): Rename to uhid if HIDRAW_MAKE_UHID_ALIAS is specified
    
    instead of renaming uhid(4) to hidraw to make easier import of coming
    u2f(4) driver which has similar option.
    
    Differential Revision:  https://reviews.freebsd.org/D51608
---
 sys/dev/hid/hidraw.c     | 12 +++++++++---
 sys/dev/usb/input/uhid.c |  6 ------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c
index 06f70070f61b..4855843cd265 100644
--- a/sys/dev/hid/hidraw.c
+++ b/sys/dev/hid/hidraw.c
@@ -85,6 +85,12 @@ SYSCTL_INT(_hw_hid_hidraw, OID_AUTO, debug, CTLFLAG_RWTUN,
                free((buf), M_DEVBUF);                  \
        }
 
+#ifdef HIDRAW_MAKE_UHID_ALIAS
+#define        HIDRAW_NAME     "uhid"
+#else
+#define        HIDRAW_NAME     "hidraw"
+#endif
+
 struct hidraw_softc {
        device_t sc_dev;                /* base device */
 
@@ -183,8 +189,8 @@ hidraw_identify(driver_t *driver, device_t parent)
 {
        device_t child;
 
-       if (device_find_child(parent, "hidraw", DEVICE_UNIT_ANY) == NULL) {
-               child = BUS_ADD_CHILD(parent, 0, "hidraw",
+       if (device_find_child(parent, HIDRAW_NAME, DEVICE_UNIT_ANY) == NULL) {
+               child = BUS_ADD_CHILD(parent, 0, HIDRAW_NAME,
                    device_get_unit(parent));
                if (child != NULL)
                        hidbus_set_index(child, HIDRAW_INDEX);
@@ -1050,7 +1056,7 @@ static device_method_t hidraw_methods[] = {
 };
 
 static driver_t hidraw_driver = {
-       "hidraw",
+       HIDRAW_NAME,
        hidraw_methods,
        sizeof(struct hidraw_softc)
 };
diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c
index a31081663f0c..e2b97f5accac 100644
--- a/sys/dev/usb/input/uhid.c
+++ b/sys/dev/usb/input/uhid.c
@@ -40,8 +40,6 @@
  * HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf
  */
 
-#include "opt_hid.h"
-
 #include <sys/stdint.h>
 #include <sys/stddef.h>
 #include <sys/param.h>
@@ -928,11 +926,7 @@ static device_method_t uhid_methods[] = {
 };
 
 static driver_t uhid_driver = {
-#ifdef HIDRAW_MAKE_UHID_ALIAS
-       .name = "hidraw",
-#else
        .name = "uhid",
-#endif
        .methods = uhid_methods,
        .size = sizeof(struct uhid_softc),
 };

Reply via email to