|
@@ -600,9 +600,9 @@ static struct bin_attribute pcie_config_attr = {
|
|
|
.write = pci_write_config,
|
|
|
};
|
|
|
|
|
|
-void __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev)
|
|
|
+int __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev)
|
|
|
{
|
|
|
- return;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
|
|
@@ -645,10 +645,14 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
|
|
|
}
|
|
|
}
|
|
|
/* add platform-specific attributes */
|
|
|
- pcibios_add_platform_entries(pdev);
|
|
|
+ if (pcibios_add_platform_entries(pdev))
|
|
|
+ goto err_rom_file;
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
+err_rom_file:
|
|
|
+ if (pci_resource_len(pdev, PCI_ROM_RESOURCE))
|
|
|
+ sysfs_remove_bin_file(&pdev->dev.kobj, rom_attr);
|
|
|
err_rom:
|
|
|
kfree(rom_attr);
|
|
|
err_resource_files:
|