mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -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
This commit is contained in:
parent
db562aeff7
commit
bc923d93df
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