Author: markj
Date: Sat Jul  8 18:53:02 2017
New Revision: 320811
URL: https://svnweb.freebsd.org/changeset/base/320811

Log:
  Add device_is_registered() to the LinuxKPI.
  
  MFC after:    1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/device.h

Modified: head/sys/compat/linuxkpi/common/include/linux/device.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/device.h      Sat Jul  8 
18:52:29 2017        (r320810)
+++ head/sys/compat/linuxkpi/common/include/linux/device.h      Sat Jul  8 
18:53:02 2017        (r320811)
@@ -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) {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to