diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index e5737f0b3997..9c4a123eacd1 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -600,9 +600,9 @@ static struct bin_attribute pcie_config_attr = { | |||
600 | .write = pci_write_config, | 600 | .write = pci_write_config, |
601 | }; | 601 | }; |
602 | 602 | ||
603 | void __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev) | 603 | int __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev) |
604 | { | 604 | { |
605 | return; | 605 | return 0; |
606 | } | 606 | } |
607 | 607 | ||
608 | int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) | 608 | 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) | |||
645 | } | 645 | } |
646 | } | 646 | } |
647 | /* add platform-specific attributes */ | 647 | /* add platform-specific attributes */ |
648 | pcibios_add_platform_entries(pdev); | 648 | if (pcibios_add_platform_entries(pdev)) |
649 | goto err_rom_file; | ||
649 | 650 | ||
650 | return 0; | 651 | return 0; |
651 | 652 | ||
653 | err_rom_file: | ||
654 | if (pci_resource_len(pdev, PCI_ROM_RESOURCE)) | ||
655 | sysfs_remove_bin_file(&pdev->dev.kobj, rom_attr); | ||
652 | err_rom: | 656 | err_rom: |
653 | kfree(rom_attr); | 657 | kfree(rom_attr); |
654 | err_resource_files: | 658 | err_resource_files: |