redhat: Add mark_driver_deprecated()

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1945179
Upstream Status: RHEL-only

Allow marking drivers deprecated. The printed message is basically
identical to what mark_hardware_deprecated() prints but generalized a
bit to cover non-hardware drivers also. Semantically, the introduced
function aligns with mark_driver_unsupported().

Signed-off-by: Phil Sutter <psutter@redhat.com>
This commit is contained in:
Phil Sutter 2021-09-02 12:23:10 +02:00 committed by Justin M. Forbes
parent eac3c1ef54
commit b30b6a3942
No known key found for this signature in database
GPG Key ID: B8FA7924A4B1C140
2 changed files with 18 additions and 0 deletions

View File

@ -538,11 +538,13 @@ void mark_hardware_unsupported(const char *msg);
void mark_hardware_deprecated(const char *msg);
void mark_tech_preview(const char *msg, struct module *mod);
void mark_driver_unsupported(const char *name);
void mark_driver_deprecated(const char *name);
#else
static inline void mark_hardware_unsupported(const char *msg) { }
static inline void mark_hardware_deprecated(const char *msg) { }
static inline void mark_tech_preview(const char *msg, struct module *mod) { }
static inline void mark_driver_unsupported(const char *name) { }
static inline void mark_driver_deprecated(const char *name) { }
#endif
#endif

View File

@ -91,3 +91,19 @@ void mark_driver_unsupported(const char *name)
name ? name : "kernel");
}
EXPORT_SYMBOL(mark_driver_unsupported);
/**
* mark_driver_deprecated() - Mark drivers as deprecated.
* @name: the name of the driver
*
* Called to minimize the support status of a previously supported driver in
* a minor release. This does not TAINT the kernel. Future
* RHEL major releases may not include this driver. Driver updates and fixes
* will be limited to critical issues in future minor releases.
*/
void mark_driver_deprecated(const char *name)
{
pr_crit("Warning: %s - this driver is not recommended for new deployments. It continues to be supported in this RHEL release, but it is likely to be removed in the next major release. Driver updates and fixes will be limited to critical issues. Please contact Red Hat Support for additional information.\n",
name ? name : "kernel");
}
EXPORT_SYMBOL(mark_driver_deprecated);