Add device_is_registered() to the LinuxKPI.

MFC after:	1 week
This commit is contained in:
Mark Johnston 2017-07-08 18:53:02 +00:00
parent 8cd823ecf7
commit aa2b6b4957

View File

@ -359,13 +359,20 @@ device_create_with_groups(struct class *class,
return dev;
}
static inline bool
device_is_registered(struct device *dev)
{
return (dev->bsddev != NULL);
}
static inline int
device_register(struct device *dev)
{
device_t bsddev = NULL;
int unit = -1;
if (dev->bsddev != NULL)
if (device_is_registered(dev))
goto done;
if (dev->devt) {