Call pci_enable_device() in DRM(irq_busid).
parent
381e0fe7f8
commit
a653224403
|
@ -32,6 +32,7 @@
|
||||||
#define __NO_VERSION__
|
#define __NO_VERSION__
|
||||||
#include "drmP.h"
|
#include "drmP.h"
|
||||||
|
|
||||||
|
|
||||||
int DRM(irq_busid)(struct inode *inode, struct file *filp,
|
int DRM(irq_busid)(struct inode *inode, struct file *filp,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
|
@ -41,8 +42,20 @@ int DRM(irq_busid)(struct inode *inode, struct file *filp,
|
||||||
if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
|
if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
|
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
|
||||||
if (dev) p.irq = dev->irq;
|
if (!dev) {
|
||||||
else p.irq = 0;
|
DRM_ERROR("pci_find_slot failed for %d:%d:%d\n",
|
||||||
|
p.busnum, p.devnum, p.funcnum);
|
||||||
|
p.irq = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if (!pci_enable_device(dev)) {
|
||||||
|
DRM_ERROR("pci_enable_device failed for %d:%d:%d\n",
|
||||||
|
p.busnum, p.devnum, p.funcnum);
|
||||||
|
p.irq = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
p.irq = dev->irq;
|
||||||
|
out:
|
||||||
DRM_DEBUG("%d:%d:%d => IRQ %d\n",
|
DRM_DEBUG("%d:%d:%d => IRQ %d\n",
|
||||||
p.busnum, p.devnum, p.funcnum, p.irq);
|
p.busnum, p.devnum, p.funcnum, p.irq);
|
||||||
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
|
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#define __NO_VERSION__
|
#define __NO_VERSION__
|
||||||
#include "drmP.h"
|
#include "drmP.h"
|
||||||
|
|
||||||
|
|
||||||
int DRM(irq_busid)(struct inode *inode, struct file *filp,
|
int DRM(irq_busid)(struct inode *inode, struct file *filp,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
|
@ -41,8 +42,20 @@ int DRM(irq_busid)(struct inode *inode, struct file *filp,
|
||||||
if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
|
if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
|
dev = pci_find_slot(p.busnum, PCI_DEVFN(p.devnum, p.funcnum));
|
||||||
if (dev) p.irq = dev->irq;
|
if (!dev) {
|
||||||
else p.irq = 0;
|
DRM_ERROR("pci_find_slot failed for %d:%d:%d\n",
|
||||||
|
p.busnum, p.devnum, p.funcnum);
|
||||||
|
p.irq = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if (!pci_enable_device(dev)) {
|
||||||
|
DRM_ERROR("pci_enable_device failed for %d:%d:%d\n",
|
||||||
|
p.busnum, p.devnum, p.funcnum);
|
||||||
|
p.irq = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
p.irq = dev->irq;
|
||||||
|
out:
|
||||||
DRM_DEBUG("%d:%d:%d => IRQ %d\n",
|
DRM_DEBUG("%d:%d:%d => IRQ %d\n",
|
||||||
p.busnum, p.devnum, p.funcnum, p.irq);
|
p.busnum, p.devnum, p.funcnum, p.irq);
|
||||||
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
|
if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
|
||||||
|
|
Loading…
Reference in New Issue