Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Mar 2009 07:55:19 +0000 (UTC)
From:      Robert Noland <rnoland@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189563 - head/sys/dev/drm
Message-ID:  <200903090755.n297tJRQ013794@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rnoland
Date: Mon Mar  9 07:55:18 2009
New Revision: 189563
URL: http://svn.freebsd.org/changeset/base/189563

Log:
  Consistently use kdev for the kernel device.
  
  Submitted by:	vehemens <vehemens@verizon.net>
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/i915_drv.c
  head/sys/dev/drm/mach64_drv.c
  head/sys/dev/drm/mga_drv.c
  head/sys/dev/drm/r128_drv.c
  head/sys/dev/drm/radeon_drv.c
  head/sys/dev/drm/savage_drv.c
  head/sys/dev/drm/sis_drv.c
  head/sys/dev/drm/tdfx_drv.c

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/drmP.h	Mon Mar  9 07:55:18 2009	(r189563)
@@ -720,10 +720,10 @@ static inline int drm_core_has_AGP(struc
 extern int	drm_debug_flag;
 
 /* Device setup support (drm_drv.c) */
-int	drm_probe(device_t nbdev, drm_pci_id_list_t *idlist);
-int	drm_attach(device_t nbdev, drm_pci_id_list_t *idlist);
+int	drm_probe(device_t kdev, drm_pci_id_list_t *idlist);
+int	drm_attach(device_t kdev, drm_pci_id_list_t *idlist);
 void	drm_close(void *data);
-int	drm_detach(device_t nbdev);
+int	drm_detach(device_t kdev);
 d_ioctl_t drm_ioctl;
 d_open_t drm_open;
 d_read_t drm_read;

Modified: head/sys/dev/drm/drm_drv.c
==============================================================================
--- head/sys/dev/drm/drm_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/drm_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -158,53 +158,53 @@ static int drm_msi_is_blacklisted(int ve
 	return 0;
 }
 
-int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
+int drm_probe(device_t kdev, drm_pci_id_list_t *idlist)
 {
 	drm_pci_id_list_t *id_entry;
 	int vendor, device;
 #if __FreeBSD_version < 700010
 	device_t realdev;
 
-	if (!strcmp(device_get_name(dev), "drmsub"))
-		realdev = device_get_parent(dev);
+	if (!strcmp(device_get_name(kdev), "drmsub"))
+		realdev = device_get_parent(kdev);
 	else
-		realdev = dev;
+		realdev = kdev;
 	vendor = pci_get_vendor(realdev);
 	device = pci_get_device(realdev);
 #else
-	vendor = pci_get_vendor(dev);
-	device = pci_get_device(dev);
+	vendor = pci_get_vendor(kdev);
+	device = pci_get_device(kdev);
 #endif
 
-	if (pci_get_class(dev) != PCIC_DISPLAY
-	    || pci_get_subclass(dev) != PCIS_DISPLAY_VGA)
+	if (pci_get_class(kdev) != PCIC_DISPLAY
+	    || pci_get_subclass(kdev) != PCIS_DISPLAY_VGA)
 		return ENXIO;
 
 	id_entry = drm_find_description(vendor, device, idlist);
 	if (id_entry != NULL) {
-		device_set_desc(dev, id_entry->name);
+		device_set_desc(kdev, id_entry->name);
 		return 0;
 	}
 
 	return ENXIO;
 }
 
-int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist)
+int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
 {
 	struct drm_device *dev;
 	drm_pci_id_list_t *id_entry;
 	int unit, msicount;
 
-	unit = device_get_unit(nbdev);
-	dev = device_get_softc(nbdev);
+	unit = device_get_unit(kdev);
+	dev = device_get_softc(kdev);
 
 #if __FreeBSD_version < 700010
-	if (!strcmp(device_get_name(nbdev), "drmsub"))
-		dev->device = device_get_parent(nbdev);
+	if (!strcmp(device_get_name(kdev), "drmsub"))
+		dev->device = device_get_parent(kdev);
 	else
-		dev->device = nbdev;
+		dev->device = kdev;
 #else
-	dev->device = nbdev;
+	dev->device = kdev;
 #endif
 	dev->devnode = make_dev(&drm_cdevsw,
 			unit,
@@ -259,11 +259,11 @@ int drm_attach(device_t nbdev, drm_pci_i
 	return drm_load(dev);
 }
 
-int drm_detach(device_t nbdev)
+int drm_detach(device_t kdev)
 {
 	struct drm_device *dev;
 
-	dev = device_get_softc(nbdev);
+	dev = device_get_softc(kdev);
 
 	drm_unload(dev);
 

Modified: head/sys/dev/drm/i915_drv.c
==============================================================================
--- head/sys/dev/drm/i915_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/i915_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -43,9 +43,9 @@ static drm_pci_id_list_t i915_pciidlist[
 	i915_PCI_IDS
 };
 
-static int i915_suspend(device_t nbdev)
+static int i915_suspend(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
 	if (!dev || !dev_priv) {
@@ -57,16 +57,16 @@ static int i915_suspend(device_t nbdev)
 
 	i915_save_state(dev);
 
-	return (bus_generic_suspend(nbdev));
+	return (bus_generic_suspend(kdev));
 }
 
-static int i915_resume(device_t nbdev)
+static int i915_resume(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	i915_restore_state(dev);
 
-	return (bus_generic_resume(nbdev));
+	return (bus_generic_resume(kdev));
 }
 
 static void i915_configure(struct drm_device *dev)
@@ -100,31 +100,31 @@ static void i915_configure(struct drm_de
 }
 
 static int
-i915_probe(device_t dev)
+i915_probe(device_t kdev)
 {
-	return drm_probe(dev, i915_pciidlist);
+	return drm_probe(kdev, i915_pciidlist);
 }
 
 static int
-i915_attach(device_t nbdev)
+i915_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	i915_configure(dev);
 
-	return drm_attach(nbdev, i915_pciidlist);
+	return drm_attach(kdev, i915_pciidlist);
 }
 
 static int
-i915_detach(device_t nbdev)
+i915_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/mach64_drv.c
==============================================================================
--- head/sys/dev/drm/mach64_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/mach64_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -77,22 +77,22 @@ static void mach64_configure(struct drm_
 }
 
 static int
-mach64_probe(device_t dev)
+mach64_probe(device_t kdev)
 {
-	return drm_probe(dev, mach64_pciidlist);
+	return drm_probe(kdev, mach64_pciidlist);
 }
 
 static int
-mach64_attach(device_t nbdev)
+mach64_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	mach64_configure(dev);
 
-	return drm_attach(nbdev, mach64_pciidlist);
+	return drm_attach(kdev, mach64_pciidlist);
 }
 
 int
@@ -102,12 +102,12 @@ mach64_driver_load(struct drm_device * d
 }
 
 static int
-mach64_detach(device_t nbdev)
+mach64_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/mga_drv.c
==============================================================================
--- head/sys/dev/drm/mga_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/mga_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -120,31 +120,31 @@ static void mga_configure(struct drm_dev
 }
 
 static int
-mga_probe(device_t dev)
+mga_probe(device_t kdev)
 {
-	return drm_probe(dev, mga_pciidlist);
+	return drm_probe(kdev, mga_pciidlist);
 }
 
 static int
-mga_attach(device_t nbdev)
+mga_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	mga_configure(dev);
 
-	return drm_attach(nbdev, mga_pciidlist);
+	return drm_attach(kdev, mga_pciidlist);
 }
 
 static int
-mga_detach(device_t nbdev)
+mga_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/r128_drv.c
==============================================================================
--- head/sys/dev/drm/r128_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/r128_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -76,22 +76,22 @@ static void r128_configure(struct drm_de
 }
 
 static int
-r128_probe(device_t dev)
+r128_probe(device_t kdev)
 {
-	return drm_probe(dev, r128_pciidlist);
+	return drm_probe(kdev, r128_pciidlist);
 }
 
 static int
-r128_attach(device_t nbdev)
+r128_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	r128_configure(dev);
 
-	return drm_attach(nbdev, r128_pciidlist);
+	return drm_attach(kdev, r128_pciidlist);
 }
 
 int r128_driver_load(struct drm_device * dev, unsigned long flags)
@@ -100,12 +100,12 @@ int r128_driver_load(struct drm_device *
 }
 
 static int
-r128_detach(device_t nbdev)
+r128_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/radeon_drv.c
==============================================================================
--- head/sys/dev/drm/radeon_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/radeon_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -80,31 +80,31 @@ static void radeon_configure(struct drm_
 }
 
 static int
-radeon_probe(device_t dev)
+radeon_probe(device_t kdev)
 {
-	return drm_probe(dev, radeon_pciidlist);
+	return drm_probe(kdev, radeon_pciidlist);
 }
 
 static int
-radeon_attach(device_t nbdev)
+radeon_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	radeon_configure(dev);
 
-	return drm_attach(nbdev, radeon_pciidlist);
+	return drm_attach(kdev, radeon_pciidlist);
 }
 
 static int
-radeon_detach(device_t nbdev)
+radeon_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/savage_drv.c
==============================================================================
--- head/sys/dev/drm/savage_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/savage_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -66,31 +66,31 @@ static void savage_configure(struct drm_
 }
 
 static int
-savage_probe(device_t dev)
+savage_probe(device_t kdev)
 {
-	return drm_probe(dev, savage_pciidlist);
+	return drm_probe(kdev, savage_pciidlist);
 }
 
 static int
-savage_attach(device_t nbdev)
+savage_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	savage_configure(dev);
 
-	return drm_attach(nbdev, savage_pciidlist);
+	return drm_attach(kdev, savage_pciidlist);
 }
 
 static int
-savage_detach(device_t nbdev)
+savage_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/sis_drv.c
==============================================================================
--- head/sys/dev/drm/sis_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/sis_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -60,31 +60,31 @@ static void sis_configure(struct drm_dev
 }
 
 static int
-sis_probe(device_t dev)
+sis_probe(device_t kdev)
 {
-	return drm_probe(dev, sis_pciidlist);
+	return drm_probe(kdev, sis_pciidlist);
 }
 
 static int
-sis_attach(device_t nbdev)
+sis_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	sis_configure(dev);
 
-	return drm_attach(nbdev, sis_pciidlist);
+	return drm_attach(kdev, sis_pciidlist);
 }
 
 static int
-sis_detach(device_t nbdev)
+sis_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 

Modified: head/sys/dev/drm/tdfx_drv.c
==============================================================================
--- head/sys/dev/drm/tdfx_drv.c	Mon Mar  9 07:50:27 2009	(r189562)
+++ head/sys/dev/drm/tdfx_drv.c	Mon Mar  9 07:55:18 2009	(r189563)
@@ -62,31 +62,31 @@ static void tdfx_configure(struct drm_de
 }
 
 static int
-tdfx_probe(device_t dev)
+tdfx_probe(device_t kdev)
 {
-	return drm_probe(dev, tdfx_pciidlist);
+	return drm_probe(kdev, tdfx_pciidlist);
 }
 
 static int
-tdfx_attach(device_t nbdev)
+tdfx_attach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 
 	dev->driver = malloc(sizeof(struct drm_driver_info), DRM_MEM_DRIVER,
 	    M_WAITOK | M_ZERO);
 
 	tdfx_configure(dev);
 
-	return drm_attach(nbdev, tdfx_pciidlist);
+	return drm_attach(kdev, tdfx_pciidlist);
 }
 
 static int
-tdfx_detach(device_t nbdev)
+tdfx_detach(device_t kdev)
 {
-	struct drm_device *dev = device_get_softc(nbdev);
+	struct drm_device *dev = device_get_softc(kdev);
 	int ret;
 
-	ret = drm_detach(nbdev);
+	ret = drm_detach(kdev);
 
 	free(dev->driver, DRM_MEM_DRIVER);
 



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