Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2009 18:24:09 +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: r194749 - head/sys/dev/drm
Message-ID:  <200906231824.n5NIO9IZ085808@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rnoland
Date: Tue Jun 23 18:24:09 2009
New Revision: 194749
URL: http://svn.freebsd.org/changeset/base/194749

Log:
  Only release irq resources if we were actually using them.
  
  MFC after:	3 days

Modified:
  head/sys/dev/drm/drm_drv.c

Modified: head/sys/dev/drm/drm_drv.c
==============================================================================
--- head/sys/dev/drm/drm_drv.c	Tue Jun 23 18:09:35 2009	(r194748)
+++ head/sys/dev/drm/drm_drv.c	Tue Jun 23 18:24:09 2009	(r194749)
@@ -273,11 +273,14 @@ int drm_detach(device_t kdev)
 
 	drm_unload(dev);
 
-	bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid, dev->irqr);
-
-	if (dev->msi_enabled) {
-		pci_release_msi(dev->device);
-		DRM_INFO("MSI released\n");
+	if (dev->irqr) {
+		bus_release_resource(dev->device, SYS_RES_IRQ, dev->irqrid,
+		    dev->irqr);
+
+		if (dev->msi_enabled) {
+			pci_release_msi(dev->device);
+			DRM_INFO("MSI released\n");
+		}
 	}
 
 	return 0;



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