Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2017 00:30:48 +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: r320633 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201707040030.v640UmHO093582@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jul  4 00:30:48 2017
New Revision: 320633
URL: https://svnweb.freebsd.org/changeset/base/320633

Log:
  Rename the "driver" field to "bsddriver" to avoid a name collision.
  
  MFC after:	1 week

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/pci.h	Tue Jul  4 00:10:29 2017	(r320632)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h	Tue Jul  4 00:30:48 2017	(r320633)
@@ -175,7 +175,7 @@ struct pci_driver {
 	int  (*suspend) (struct pci_dev *dev, pm_message_t state);	/* Device suspended */
 	int  (*resume) (struct pci_dev *dev);		/* Device woken up */
 	void (*shutdown) (struct pci_dev *dev);		/* Device shutdown */
-	driver_t			driver;
+	driver_t			bsddriver;
 	devclass_t			bsdclass;
         const struct pci_error_handlers       *err_handler;
 };

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_pci.c	Tue Jul  4 00:10:29 2017	(r320632)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c	Tue Jul  4 00:30:48 2017	(r320633)
@@ -108,7 +108,7 @@ linux_pci_probe(device_t dev)
 
 	if ((pdrv = linux_pci_find(dev, &id)) == NULL)
 		return (ENXIO);
-	if (device_get_driver(dev) != &pdrv->driver)
+	if (device_get_driver(dev) != &pdrv->bsddriver)
 		return (ENXIO);
 	device_set_desc(dev, pdrv->name);
 	return (0);
@@ -235,13 +235,14 @@ pci_register_driver(struct pci_driver *pdrv)
 	spin_lock(&pci_lock);
 	list_add(&pdrv->links, &pci_drivers);
 	spin_unlock(&pci_lock);
-	pdrv->driver.name = pdrv->name;
-	pdrv->driver.methods = pci_methods;
-	pdrv->driver.size = sizeof(struct pci_dev);
+	pdrv->bsddriver.name = pdrv->name;
+	pdrv->bsddriver.methods = pci_methods;
+	pdrv->bsddriver.size = sizeof(struct pci_dev);
+
 	mtx_lock(&Giant);
 	if (bus != NULL) {
-		error = devclass_add_driver(bus, &pdrv->driver, BUS_PASS_DEFAULT,
-		    &pdrv->bsdclass);
+		error = devclass_add_driver(bus, &pdrv->bsddriver,
+		    BUS_PASS_DEFAULT, &pdrv->bsdclass);
 	}
 	mtx_unlock(&Giant);
 	return (-error);
@@ -259,7 +260,7 @@ pci_unregister_driver(struct pci_driver *pdrv)
 	spin_unlock(&pci_lock);
 	mtx_lock(&Giant);
 	if (bus != NULL)
-		devclass_delete_driver(bus, &pdrv->driver);
+		devclass_delete_driver(bus, &pdrv->bsddriver);
 	mtx_unlock(&Giant);
 }
 



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