Commit c2608a11 authored by rajesh.shah@intel.com's avatar rajesh.shah@intel.com Committed by Greg Kroah-Hartman

[PATCH] shpchp: fix oops at driver unload

At unload time, the shpchp driver does not remove sysfs files
it had created in the driver's probe entry point. This patch
fixes this problem.
Signed-off-by: default avatarRajesh Shah <rajesh.shah@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7c8942f9
...@@ -173,6 +173,7 @@ extern void get_hp_params_from_firmware(struct pci_dev *dev, ...@@ -173,6 +173,7 @@ extern void get_hp_params_from_firmware(struct pci_dev *dev,
struct hotplug_params *hpp); struct hotplug_params *hpp);
extern int shpchprm_get_physical_slot_number(struct controller *ctrl, extern int shpchprm_get_physical_slot_number(struct controller *ctrl,
u32 *sun, u8 busnum, u8 devnum); u32 *sun, u8 busnum, u8 devnum);
extern void shpchp_remove_ctrl_files(struct controller *ctrl);
/* Global variables */ /* Global variables */
......
...@@ -480,6 +480,7 @@ static void __exit unload_shpchpd(void) ...@@ -480,6 +480,7 @@ static void __exit unload_shpchpd(void)
ctrl = shpchp_ctrl_list; ctrl = shpchp_ctrl_list;
while (ctrl) { while (ctrl) {
shpchp_remove_ctrl_files(ctrl);
cleanup_slots(ctrl); cleanup_slots(ctrl);
kfree (ctrl->pci_bus); kfree (ctrl->pci_bus);
......
...@@ -89,3 +89,8 @@ void shpchp_create_ctrl_files (struct controller *ctrl) ...@@ -89,3 +89,8 @@ void shpchp_create_ctrl_files (struct controller *ctrl)
{ {
device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl);
} }
void shpchp_remove_ctrl_files(struct controller *ctrl)
{
device_remove_file(&ctrl->pci_dev->dev, &dev_attr_ctrl);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment