The following commit to 14-CURRENT renamed struct device to struct _device.
commit dfff37765ce4ea4fd7db4d293b459dc84008f411
Author: Mark Johnston <markj@FreeBSD.org>
Date: Mon Apr 12 09:32:30 2021 -0400
Rename struct device to struct _device types.h defines device_t as a typedef of struct device *. struct device is defined in subr_bus.c and almost all of the kernel uses device_t. The LinuxKPI also defines a struct device, so type confusion can occur. This causes bugs and ambiguity for debugging tools. Rename the FreeBSD struct device to struct _device. Reviewed by: gbe (man pages) Reviewed by: rpokala, imp, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29676
A check for __FreeBSD_version > 1400009 resolves the issue.