Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jul 2017 18:53:02 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320811 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201707081853.v68Ir2uA049060@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707081853.v68Ir2uA049060>