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:
Vladimir Kondratyev 2021-11-15 18:09:14 +03:00
parent b3407b54d3
commit bc3e9499ca

View file

@ -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)
{