aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/pci.txt6
-rw-r--r--drivers/pci/pci-driver.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/Documentation/pci.txt b/Documentation/pci.txt
index cdf2f3c0ab14..a8ded1a8bd62 100644
--- a/Documentation/pci.txt
+++ b/Documentation/pci.txt
@@ -163,9 +163,9 @@ echo "vendor device subvendor subdevice class class_mask driver_data" > \
163/sys/bus/pci/drivers/{driver}/new_id 163/sys/bus/pci/drivers/{driver}/new_id
164 164
165All fields are passed in as hexadecimal values (no leading 0x). 165All fields are passed in as hexadecimal values (no leading 0x).
166Users need pass only as many fields as necessary: 166The vendor and device fields are mandatory, the others are optional. Users
167 o vendor, device, subvendor, and subdevice fields default 167need pass only as many optional fields as necessary:
168 to PCI_ANY_ID (FFFFFFFF), 168 o subvendor and subdevice fields default to PCI_ANY_ID (FFFFFFFF)
169 o class and classmask fields default to 0 169 o class and classmask fields default to 0
170 o driver_data defaults to 0UL. 170 o driver_data defaults to 0UL.
171 171
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 39e80fcef4b3..07fdb3cd6172 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -52,7 +52,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
52{ 52{
53 struct pci_dynid *dynid; 53 struct pci_dynid *dynid;
54 struct pci_driver *pdrv = to_pci_driver(driver); 54 struct pci_driver *pdrv = to_pci_driver(driver);
55 __u32 vendor=PCI_ANY_ID, device=PCI_ANY_ID, subvendor=PCI_ANY_ID, 55 __u32 vendor, device, subvendor=PCI_ANY_ID,
56 subdevice=PCI_ANY_ID, class=0, class_mask=0; 56 subdevice=PCI_ANY_ID, class=0, class_mask=0;
57 unsigned long driver_data=0; 57 unsigned long driver_data=0;
58 int fields=0; 58 int fields=0;
@@ -61,7 +61,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
61 fields = sscanf(buf, "%x %x %x %x %x %x %lux", 61 fields = sscanf(buf, "%x %x %x %x %x %x %lux",
62 &vendor, &device, &subvendor, &subdevice, 62 &vendor, &device, &subvendor, &subdevice,
63 &class, &class_mask, &driver_data); 63 &class, &class_mask, &driver_data);
64 if (fields < 0) 64 if (fields < 2)
65 return -EINVAL; 65 return -EINVAL;
66 66
67 dynid = kzalloc(sizeof(*dynid), GFP_KERNEL); 67 dynid = kzalloc(sizeof(*dynid), GFP_KERNEL);