DEFINE_CLASS() is in fact named LINUXKPI_DEFINE_CLASS() because it conflicts with DEFINE_CLASS() defined in <sys/kobj.h>.
This macro defines a type and a pair of constructor/destructor functions.
They are to be used by CLASS(): this one declares a variable, initialise it with the constructor and set the __cleanup() attribute to call the destructor once the variable goes out of scope.
The DRM drivers generic code started to use CLASS() in Linux 6.13. It requires the fd class to be defined in <linux/file.h>.
This is part of the update of DRM drivers to Linux 6.13.
Sponsored by: The FreeBSD Foundation