aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/syscall.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:40:57 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:40:57 -0400
commit21ba0f88ae56da82a3a15fe54d729208b64c4f4b (patch)
tree17ce67f276fe3ea7284c3dc730bdd6a2ec7dfe2f /drivers/pci/syscall.c
parentdc690d8ef842b464f1c429a376ca16cb8dbee6ae (diff)
parent36e235901f90fb83215be43cbd8f1ca14661ea40 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (34 commits) PCI: Only build PCI syscalls on architectures that want them PCI: limit pci_get_bus_and_slot to domain 0 PCI: hotplug: acpiphp: avoid acpiphp "cannot get bridge info" PCI hotplug failure PCI: hotplug: acpiphp: remove hot plug parameter write to PCI host bridge PCI: hotplug: acpiphp: fix slot poweroff problem on systems without _PS3 PCI: hotplug: pciehp: wait for 1 second after power off slot PCI: pci_set_power_state(): check for PM capabilities earlier PCI: cpci_hotplug: Convert to use the kthread API PCI: add pci_try_set_mwi PCI: pcie: remove SPIN_LOCK_UNLOCKED PCI: ROUND_UP macro cleanup in drivers/pci PCI: remove pci_dac_dma_... APIs PCI: pci-x-pci-express-read-control-interfaces cleanups PCI: Fix typo in include/linux/pci.h PCI: pci_ids, remove double or more empty lines PCI: pci_ids, add atheros and 3com_2 vendors PCI: pci_ids, reorder some entries PCI: i386: traps, change VENDOR to DEVICE PCI: ATM: lanai, change VENDOR to DEVICE PCI: Change all drivers to use pci_device->revision ...
Diffstat (limited to 'drivers/pci/syscall.c')
-rw-r--r--drivers/pci/syscall.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 9d37fec27f24..2ac050d7f8cf 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -23,14 +23,14 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
23 u8 byte; 23 u8 byte;
24 u16 word; 24 u16 word;
25 u32 dword; 25 u32 dword;
26 long err, cfg_ret; 26 long err;
27 long cfg_ret;
27 28
28 err = -EPERM;
29 if (!capable(CAP_SYS_ADMIN)) 29 if (!capable(CAP_SYS_ADMIN))
30 goto error; 30 return -EPERM;
31 31
32 err = -ENODEV; 32 err = -ENODEV;
33 dev = pci_find_slot(bus, dfn); 33 dev = pci_get_bus_and_slot(bus, dfn);
34 if (!dev) 34 if (!dev)
35 goto error; 35 goto error;
36 36
@@ -66,7 +66,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
66 case 4: 66 case 4:
67 err = put_user(dword, (unsigned int __user *)buf); 67 err = put_user(dword, (unsigned int __user *)buf);
68 break; 68 break;
69 }; 69 }
70 pci_dev_put(dev);
70 return err; 71 return err;
71 72
72error: 73error:
@@ -83,7 +84,8 @@ error:
83 case 4: 84 case 4:
84 put_user(-1, (unsigned int __user *)buf); 85 put_user(-1, (unsigned int __user *)buf);
85 break; 86 break;
86 }; 87 }
88 pci_dev_put(dev);
87 return err; 89 return err;
88} 90}
89 91
@@ -101,7 +103,7 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
101 if (!capable(CAP_SYS_ADMIN)) 103 if (!capable(CAP_SYS_ADMIN))
102 return -EPERM; 104 return -EPERM;
103 105
104 dev = pci_find_slot(bus, dfn); 106 dev = pci_get_bus_and_slot(bus, dfn);
105 if (!dev) 107 if (!dev)
106 return -ENODEV; 108 return -ENODEV;
107 109
@@ -137,8 +139,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
137 default: 139 default:
138 err = -EINVAL; 140 err = -EINVAL;
139 break; 141 break;
140 }; 142 }
141 unlock_kernel(); 143 unlock_kernel();
142 144 pci_dev_put(dev);
143 return err; 145 return err;
144} 146}