mirror of
https://github.com/opnsense/src.git
synced 2026-05-19 08:25:22 -04:00
LinuxKPI: Implement dev_driver_string()
Required by drm-kmod 5.7
MFC after: 1 week
Reviewed by: bz, hselasky, manu
Differential Revision: https://reviews.freebsd.org/D33290
(cherry picked from commit bc923d93df)
This commit is contained in:
parent
b3407b54d3
commit
bc3e9499ca
1 changed files with 15 additions and 0 deletions
|
|
@ -228,6 +228,21 @@ void lkpi_devres_release_free_list(struct device *);
|
|||
void lkpi_devres_unlink(struct device *, void *);
|
||||
void lkpi_devm_kmalloc_release(struct device *, void *);
|
||||
|
||||
static inline const char *
|
||||
dev_driver_string(const struct device *dev)
|
||||
{
|
||||
driver_t *drv;
|
||||
const char *str = "";
|
||||
|
||||
if (dev->bsddev != NULL) {
|
||||
drv = device_get_driver(dev->bsddev);
|
||||
if (drv != NULL)
|
||||
str = drv->name;
|
||||
}
|
||||
|
||||
return (str);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
dev_get_drvdata(const struct device *dev)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue