From foo@baz Tue Apr 9 12:12:43 2002 Date: Mon, 28 Aug 2006 11:43:25 -0700 To: Greg KH From: Greg Kroah-Hartman Subject: SHPCHP: fix __must_check warnings Cc: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/shpchp.h | 2 +- drivers/pci/hotplug/shpchp_core.c | 6 +++++- drivers/pci/hotplug/shpchp_sysfs.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) --- gregkh-2.6.orig/drivers/pci/hotplug/shpchp.h +++ gregkh-2.6/drivers/pci/hotplug/shpchp.h @@ -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); --- gregkh-2.6.orig/drivers/pci/hotplug/shpchp_core.c +++ gregkh-2.6/drivers/pci/hotplug/shpchp_core.c @@ -449,10 +449,14 @@ static int shpc_probe(struct pci_dev *pd 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: --- gregkh-2.6.orig/drivers/pci/hotplug/shpchp_sysfs.c +++ gregkh-2.6/drivers/pci/hotplug/shpchp_sysfs.c @@ -91,9 +91,9 @@ static ssize_t show_ctrl (struct device } 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)