Page MenuHomeFreeBSD

Deprecate the 'devclass' argument from *DRIVER_MODULE() macros.
ClosedPublic

Authored by jhb on Apr 19 2022, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 24 2024, 9:56 PM
Unknown Object (File)
Mar 8 2024, 10:32 PM
Unknown Object (File)
Feb 25 2024, 4:56 AM
Unknown Object (File)
Feb 16 2024, 7:56 PM
Unknown Object (File)
Jan 14 2024, 8:41 AM
Unknown Object (File)
Dec 23 2023, 12:11 AM
Unknown Object (File)
Dec 9 2023, 10:05 PM
Unknown Object (File)
Oct 30 2023, 8:36 AM

Details

Summary

This argument is useless for the vast majority of drivers. For now,
use VA_ARGS wrapper macros so that that the *DRIVER_MODULE()
macros except both the old version (with a devclass) and the new
version (which omits the argument and stores NULL in the
driver_module_data structure). This provides an API compatiblity
shim that can be merged to older stable branches.

Once all drivers relevant to 14.0 (both in and out of tree) have been
updated, the API compat shims can be dropped.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

  • Update DRIVER_MODULE.9 which I missed earlier.

While I normally I hate this kind of tricky vararg stuff, I think in this case, it's good.

This revision is now accepted and ready to land.Apr 19 2022, 5:20 PM

Commit message typo: s/except/accept/

share/man/man9/DRIVER_MODULE.9
147

Putting the cart before the horse here? If I understand the intent of this change right, it deprecates the devclass argument, but doesn't remove it yet. Documenting that would alleviate confusion when exposed to drivers still using it.

share/man/man9/DRIVER_MODULE.9
147

It will be gone in a couple of weeks, and my intent is that people writing new code shouldn't use it. I also plan to MFC the API change to make it optional so that any new code going forward should not use it even on older supported branches.

share/man/man9/DRIVER_MODULE.9
147

In "it will be gone", does "it" refer to existing driver code in -current that uses this argument?

share/man/man9/DRIVER_MODULE.9
147

Along with support for it in the API, yes.