On Linux, a struct kernfs_node * pointer, representing a directory in sysfs, is kept in the sd struct field.
We don't have that on FreeBSD because we use sysctls instead. Let's alias the sysctl OID pointer to sd using an union.
This pointer is checked by the DRM drivers using:
if (var->kobj.sd) {
...
}The amdgpu DRM driver started to use these checks in Linux 6.13.
This is part of the update of DRM drivers to Linux 6.13.
Sponsored by: The FreeBSD Foundation