svn commit: r320811 - head/sys/compat/linuxkpi/common/include/linux

Mark Johnston markj at FreeBSD.org
Sat Jul 8 18:53:03 UTC 2017


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


More information about the svn-src-head mailing list