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
F97681438: D34963.diff
Mon, Sep 30, 6:20 PM
Unknown Object (File)
Sat, Sep 28, 8:28 AM
Unknown Object (File)
Fri, Sep 27, 6:17 PM
Unknown Object (File)
Fri, Sep 27, 12:52 PM
Unknown Object (File)
Fri, Sep 13, 1:58 AM
Unknown Object (File)
Sat, Sep 7, 7:16 AM
Unknown Object (File)
Fri, Sep 6, 1:16 AM
Unknown Object (File)
Thu, Sep 5, 9:31 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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45230
Build 42118: arc lint + arc unit

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 ↗(On Diff #105183)

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 ↗(On Diff #105183)

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 ↗(On Diff #105183)

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 ↗(On Diff #105183)

Along with support for it in the API, yes.