SHPCHP: fix __must_check warnings
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 28 Aug 2006 18:43:25 +0000 (11:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 27 Sep 2006 00:43:53 +0000 (17:43 -0700)
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/shpchp.h
drivers/pci/hotplug/shpchp_core.c
drivers/pci/hotplug/shpchp_sysfs.c

index 7208b95c6ee779585ff056bcdaeb091140f44961..c7103ac5cd06b76da2c0ec60381003601bd98bc1 100644 (file)
@@ -173,7 +173,7 @@ struct controller {
 #define msg_button_cancel      "PCI slot #%s - action canceled due to button press.\n"
 
 /* sysfs functions for the hotplug controller info */
-extern void shpchp_create_ctrl_files   (struct controller *ctrl);
+extern int __must_check shpchp_create_ctrl_files(struct controller *ctrl);
 
 extern int     shpchp_sysfs_enable_slot(struct slot *slot);
 extern int     shpchp_sysfs_disable_slot(struct slot *slot);
index a14e7de1984621cd9281751df06cc0624fee5d87..235c18a22393d04e0ba86ec5f511d086149f6d75 100644 (file)
@@ -449,10 +449,14 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                ctrl->speed = PCI_SPEED_33MHz;
        }
 
-       shpchp_create_ctrl_files(ctrl);
+       rc = shpchp_create_ctrl_files(ctrl);
+       if (rc)
+               goto err_cleanup_slots;
 
        return 0;
 
+err_cleanup_slots:
+       cleanup_slots(ctrl);
 err_out_release_ctlr:
        ctrl->hpc_ops->release_ctlr(ctrl);
 err_out_free_ctrl:
index 620e1139e607c763dfaa69ff25413c971de82310..29fa9d26adae28b0e49e0a39e16796439f1c4b4f 100644 (file)
@@ -91,9 +91,9 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
 }
 static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL);
 
-void shpchp_create_ctrl_files (struct controller *ctrl)
+int __must_check shpchp_create_ctrl_files (struct controller *ctrl)
 {
-       device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl);
+       return device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl);
 }
 
 void shpchp_remove_ctrl_files(struct controller *ctrl)