git: 64b530b38be3 - stable/15 - u2f(4): Invert U2F_MAKE_UHID_ALIAS kernel build option

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Sat, 27 Sep 2025 10:26:53 UTC
The branch stable/15 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=64b530b38be37ebf32596a5ee7ab95f484f49176

commit 64b530b38be37ebf32596a5ee7ab95f484f49176
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2025-09-25 07:54:19 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2025-09-27 10:25:11 +0000

    u2f(4): Invert U2F_MAKE_UHID_ALIAS kernel build option
    
    This makes non-GENERIC kernel configs easier to maintain.
    
    Requested by:   glebius
    MFC after:      2 days
    
    (cherry picked from commit e43fbf27976df17991d32c72c41e43fda66fb262)
---
 sys/amd64/conf/GENERIC       | 1 -
 sys/arm/conf/GENERIC         | 1 -
 sys/arm64/conf/std.dev       | 1 -
 sys/conf/NOTES               | 3 ++-
 sys/conf/options             | 2 +-
 sys/dev/hid/u2f.c            | 8 ++++----
 sys/i386/conf/GENERIC        | 1 -
 sys/powerpc/conf/GENERIC64   | 1 -
 sys/powerpc/conf/GENERIC64LE | 1 -
 sys/riscv/conf/GENERIC       | 1 -
 10 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index bbbb94f05191..b3d60c6e68d9 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -384,7 +384,6 @@ options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
 options 	IICHID_SAMPLING		# Workaround missing GPIO INTR support
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # EFI devices
 device		efidev			# EFI pseudo-device
diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC
index 26b0c7bf0294..7394f3842d43 100644
--- a/sys/arm/conf/GENERIC
+++ b/sys/arm/conf/GENERIC
@@ -261,7 +261,6 @@ device		aw_thermal	# Allwinner Thermal Sensor Controller
 # HID support
 device		hid		# Generic HID support
 device		hidbus		# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # Flattened Device Tree
 options 	FDT			# Configure using FDT/DTB data
diff --git a/sys/arm64/conf/std.dev b/sys/arm64/conf/std.dev
index 719f272426dd..c5c364ffda04 100644
--- a/sys/arm64/conf/std.dev
+++ b/sys/arm64/conf/std.dev
@@ -115,7 +115,6 @@ device		mmcsd			# mmc/sd flash cards
 options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # Firmware
 device		mmio_sram		# Generic on-chip SRAM
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index c7a8862fb906..ea9b2667607e 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -2447,7 +2447,8 @@ device		hpen		# Generic pen driver
 device		hsctrl		# System controls
 device		ps4dshock	# Sony PS4 DualShock 4 gamepad driver
 device		u2f		# FIDO/U2F authenticator
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
+options 	U2F_DROP_UHID_ALIAS	# Do not install /dev/uhid alias for
+				# /dev/u2f/ and rename driver from uhid to u2f
 device		xb360gp		# XBox 360 gamepad driver
 
 #####################################################################
diff --git a/sys/conf/options b/sys/conf/options
index 66f7f2ee2d7e..b48ad1cf42cf 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -1004,7 +1004,7 @@ IICHID_DEBUG	opt_hid.h
 IICHID_SAMPLING	opt_hid.h
 HKBD_DFLT_KEYMAP	opt_hkbd.h
 HIDRAW_MAKE_UHID_ALIAS	opt_hid.h
-U2F_MAKE_UHID_ALIAS	opt_hid.h
+U2F_DROP_UHID_ALIAS	opt_hid.h
 
 # kenv options
 # The early kernel environment (loader environment, config(8)-provided static)
diff --git a/sys/dev/hid/u2f.c b/sys/dev/hid/u2f.c
index 39610845c5fb..08f1a5ceedba 100644
--- a/sys/dev/hid/u2f.c
+++ b/sys/dev/hid/u2f.c
@@ -193,7 +193,7 @@ u2f_attach(device_t dev)
 		u2f_detach(dev);
 		return (error);
 	}
-#ifdef U2F_MAKE_UHID_ALIAS
+#ifndef U2F_DROP_UHID_ALIAS
 	(void)make_dev_alias(sc->dev, "uhid%d", device_get_unit(dev));
 #endif
 
@@ -587,10 +587,10 @@ static device_method_t u2f_methods[] = {
 };
 
 static driver_t u2f_driver = {
-#ifdef U2F_MAKE_UHID_ALIAS
-	"uhid",
+#ifdef U2F_DROP_UHID_ALIAS
+	"uf2",
 #else
-	"u2f",
+	"uhid",
 #endif
 	u2f_methods,
 	sizeof(struct u2f_softc)
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC
index 2cc883de94fa..f09e8b0703e4 100644
--- a/sys/i386/conf/GENERIC
+++ b/sys/i386/conf/GENERIC
@@ -341,4 +341,3 @@ options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
 options 	IICHID_SAMPLING		# Workaround missing GPIO INTR support
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64
index 8fb1eeea23c3..446e3afca511 100644
--- a/sys/powerpc/conf/GENERIC64
+++ b/sys/powerpc/conf/GENERIC64
@@ -291,4 +291,3 @@ device          virtio_balloon          # VirtIO Memory Balloon device
 options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE
index 0a150044dcc3..b1a2d12713a8 100644
--- a/sys/powerpc/conf/GENERIC64LE
+++ b/sys/powerpc/conf/GENERIC64LE
@@ -272,4 +272,3 @@ device          virtio_balloon          # VirtIO Memory Balloon device
 options 	HID_DEBUG		# enable debug msgs
 device		hid			# Generic HID support
 device		hidbus			# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC
index 187e7396e884..ffd958bb33bf 100644
--- a/sys/riscv/conf/GENERIC
+++ b/sys/riscv/conf/GENERIC
@@ -132,7 +132,6 @@ device		umass			# Disks/Mass storage - Requires scbus and da
 options 	HID_DEBUG	# enable debug msgs
 device		hid		# Generic HID support
 device		hidbus		# Generic HID Bus
-options 	U2F_MAKE_UHID_ALIAS	# install /dev/uhid alias for /dev/u2f/
 
 # Serial (COM) ports
 device		uart		# Generic UART driver