diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-05-07 22:03:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:02:07 -0400 |
commit | a2cd52ca904f5913651e71764755e712894ccc2f (patch) | |
tree | ea852daa5f2217a9caf1485ec6fffac5412ac7c7 /drivers/pci | |
parent | 575e3348cb80c3265278756778d5091d5ca4efbf (diff) |
PCI: Make pcibios_add_platform_entries() return errors
Currently pcibios_add_platform_entries() returns void, but could fail,
so instead have it return an int and propagate errors up to
pci_create_sysfs_dev_files().
Fixes:
arch/powerpc/kernel/pci_64.c: In function 'pcibios_add_platform_entries':
arch/powerpc/kernel/pci_64.c:878: warning: ignoring return value of
'device_create_file', declared with attribute warn_unused_result
arch/powerpc/kernel/pci_32.c: In function 'pcibios_add_platform_entries':
arch/powerpc/kernel/pci_32.c:1043: warning: ignoring return value of
'device_create_file', declared with attribute warn_unused_result
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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: |