On 10/02/2012 03:32 AM, Yuval Mintz wrote:
+static void pci_sriov_remove_sysfs_dev_files(struct pci_dev *dev)
+{
+ int pos;
+
+ if ((dev->is_physfn)&& pci_is_pcie(dev)) {
+ pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV);
+ if (pos)
+ device_remove_file(&dev->dev, pci_dev_sriov_attrs);
Shouldn't it iterate over the attributes when removing them?
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
good catch; that should be:
+ int pos, i;
....
+ for (i = 0; attr_name(pci_dev_sriov_attrs[i]); i++)
+ device_remove_file(&dev->dev, &pci_dev_sriov_attrs);
it doesn't remove the files in reverse order, but neither does
the device-generic code for dev-attrs.
Another question for RFC:
-- above shows I didn't test with hot-plug
-- which makes me wonder/think if [get,put]_device([dev,parent]) needed
during [create,remove]_file() calls.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html