diff options
| author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2021-11-15 15:09:14 +0000 |
|---|---|---|
| committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2022-01-10 19:49:37 +0000 |
| commit | bc923d93dffc9d82a705d4e5b9960daa9acdcca6 (patch) | |
| tree | 99bdd6c7af81b326655e3054296b5ab02d0a5b35 | |
| parent | db562aeff7755a1128165cc0fbf8252756004847 (diff) | |
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/device.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 71cca729243a..010eb2d316cd 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -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) { |
