Skip to contentSkip to conversation

Input: scan pci_bus_type

PATCH Applied Roel Kluin 2 participants 3 messages Jan 28, 2009 – Feb 2, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Input: scan pci_bus_type

scan pci_bus_type rather then a get/put

---

drivers/input/mouse/pc110pad.c +1 -4
index fd09c8d..f63995f 100644
@@ -111,11 +111,8 @@ static int __init pc110pad_init(void)
 	struct pci_dev *dev;
 	int err;
 
-	dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
-	if (dev) {
-		pci_dev_put(dev);
+	if (!no_pci_devices())
 		return -ENODEV;
-	}
 
 	if (!request_region(pc110pad_io, 4, "pc110pad")) {
 		printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n",
author
#2 lore raw
Quoted 7 lines · Dmitry Torokhov
Quoted 3 lines · Roel Kluin

scan pci_bus_type rather then a get/put

Applied to by 'next' branch, thank you Roel.

A bit better is this patch, since struct pci_dev *dev isn't used anywhere else in this function. ------------------->8--------------8<---------------------- scan pci_bus_type rather then a get/put

---

drivers/input/mouse/pc110pad.c +1 -5
index fd09c8d..3941f97 100644
@@ -108,14 +108,10 @@ static int pc110pad_open(struct input_dev *dev)
  */
 static int __init pc110pad_init(void)
 {
-	struct pci_dev *dev;
 	int err;
 
-	dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
-	if (dev) {
-		pci_dev_put(dev);
+	if (!no_pci_devices())
 		return -ENODEV;
-	}
 
 	if (!request_region(pc110pad_io, 4, "pc110pad")) {
 		printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n",