Commit 0741a951 authored by Diego Woitasen's avatar Diego Woitasen Committed by Greg Kroah-Hartman

PCI: remove unneeded lock_kernel() in drivers/pci/syscall.c.

sys_pciconfig_{read,write}() are protected against PCI removal with the
reference count in struct pci_dev.  The concurrency of
pci_user_{read,write}_config_* functions are already protected by pci_lock
in drivers/pci/access.c.
Signed-off-by: default avatarDiego Woitasen <diego@woitasen.com.ar>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 10d7425d
...@@ -34,7 +34,6 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn, ...@@ -34,7 +34,6 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
if (!dev) if (!dev)
goto error; goto error;
lock_kernel();
switch (len) { switch (len) {
case 1: case 1:
cfg_ret = pci_user_read_config_byte(dev, off, &byte); cfg_ret = pci_user_read_config_byte(dev, off, &byte);
...@@ -47,10 +46,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn, ...@@ -47,10 +46,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
break; break;
default: default:
err = -EINVAL; err = -EINVAL;
unlock_kernel();
goto error; goto error;
}; };
unlock_kernel();
err = -EIO; err = -EIO;
if (cfg_ret != PCIBIOS_SUCCESSFUL) if (cfg_ret != PCIBIOS_SUCCESSFUL)
...@@ -107,7 +104,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -107,7 +104,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
lock_kernel();
switch(len) { switch(len) {
case 1: case 1:
err = get_user(byte, (u8 __user *)buf); err = get_user(byte, (u8 __user *)buf);
...@@ -140,7 +136,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, ...@@ -140,7 +136,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
err = -EINVAL; err = -EINVAL;
break; break;
} }
unlock_kernel();
pci_dev_put(dev); pci_dev_put(dev);
return err; return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment