mirror of
https://github.com/opnsense/src.git
synced 2026-04-25 08:07:28 -04:00
Add device_is_registered() to the LinuxKPI.
MFC after: 1 week
This commit is contained in:
parent
8cd823ecf7
commit
aa2b6b4957
1 changed files with 8 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue