diff options
author | rnoland <rnoland@FreeBSD.org> | 2009-06-23 18:24:09 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2009-06-23 18:24:09 +0000 |
commit | 504701419dd7c10eaddaa02131f1db5957f19658 (patch) | |
tree | 389d12000ff37f05b2d0f942a19994006b2deb80 /sys/dev/drm | |
parent | a1716da758d1e3f65817abf2b0487a7519cb60b5 (diff) | |
download | FreeBSD-src-504701419dd7c10eaddaa02131f1db5957f19658.zip FreeBSD-src-504701419dd7c10eaddaa02131f1db5957f19658.tar.gz |
Only release irq resources if we were actually using them.
MFC after: 3 days
Diffstat (limited to 'sys/dev/drm')
-rw-r--r-- | sys/dev/drm/drm_drv.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c index dca4fea..561afd5 100644 --- a/sys/dev/drm/drm_drv.c +++ b/sys/dev/drm/drm_drv.c @@ -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->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"); + if (dev->msi_enabled) { + pci_release_msi(dev->device); + DRM_INFO("MSI released\n"); + } } return 0; |