@@ -174,7 +174,9 @@ int pci_bus_add_device(struct pci_dev *dev)
* Can not put in pci_device_add yet because resources
* are not assigned yet for some devices.
*/
- pci_create_sysfs_dev_files(dev);
+ retval = pci_create_sysfs_dev_files(dev);
+ if (retval)
+ return retval;
dev->match_driver = true;
retval = device_attach(&dev->dev);
@@ -1299,7 +1299,7 @@ error:
return retval;
}
-int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
+int pci_create_sysfs_dev_files (struct pci_dev *pdev)
{
int retval;
int rom_size = 0;
@@ -8,7 +8,7 @@
/* Functions internal to the PCI core code */
-extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
+extern int __must_check pci_create_sysfs_dev_files(struct pci_dev *pdev);
extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
#if !defined(CONFIG_DMI) && !defined(CONFIG_ACPI)
static inline void pci_create_firmware_label_files(struct pci_dev *pdev)
The __must_check (gcc "warn_unused_result") attribute only makes sense when compiling the *caller* of the function, so the annotation of the pci_create_sysfs_dev_files() definition did nothing. This moves the annotation to the declaration and fixes the resulting warning. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> --- drivers/pci/bus.c | 4 +++- drivers/pci/pci-sysfs.c | 2 +- drivers/pci/pci.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html