diff options
author | rajesh.shah@intel.com <rajesh.shah@intel.com> | 2005-10-13 15:05:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 18:37:00 -0400 |
commit | ee138334d5eb5ca662b2d69228420c1ccc051e0e (patch) | |
tree | 6c8f0d28ab39f4ea9abb0e9986f8c9a3fca6f470 /drivers/pci/hotplug/shpchp_ctrl.c | |
parent | 2178bfad9ccb0cbeb79599dd1dc349dd4567aa49 (diff) |
[PATCH] shpchp: miscellaneous cleanups
Remove un-necessary header includes, remove dead code, remove
some type casts, receive function return in the correct data
type...
Signed-off-by: Rajesh Shah <rajesh.shah@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_ctrl.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index b6fde3565e55..8541180781e1 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -27,15 +27,9 @@ | |||
27 | * | 27 | * |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/config.h> | ||
31 | #include <linux/module.h> | 30 | #include <linux/module.h> |
32 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
33 | #include <linux/types.h> | 32 | #include <linux/types.h> |
34 | #include <linux/slab.h> | ||
35 | #include <linux/workqueue.h> | ||
36 | #include <linux/interrupt.h> | ||
37 | #include <linux/delay.h> | ||
38 | #include <linux/wait.h> | ||
39 | #include <linux/smp_lock.h> | 33 | #include <linux/smp_lock.h> |
40 | #include <linux/pci.h> | 34 | #include <linux/pci.h> |
41 | #include "../pci.h" | 35 | #include "../pci.h" |
@@ -242,9 +236,10 @@ u8 shpchp_handle_power_fault(u8 hp_slot, void *inst_id) | |||
242 | /* The following routines constitute the bulk of the | 236 | /* The following routines constitute the bulk of the |
243 | hotplug controller logic | 237 | hotplug controller logic |
244 | */ | 238 | */ |
245 | static u32 change_bus_speed(struct controller *ctrl, struct slot *p_slot, enum pci_bus_speed speed) | 239 | static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, |
240 | enum pci_bus_speed speed) | ||
246 | { | 241 | { |
247 | u32 rc = 0; | 242 | int rc = 0; |
248 | 243 | ||
249 | dbg("%s: change to speed %d\n", __FUNCTION__, speed); | 244 | dbg("%s: change to speed %d\n", __FUNCTION__, speed); |
250 | down(&ctrl->crit_sect); | 245 | down(&ctrl->crit_sect); |
@@ -266,10 +261,11 @@ static u32 change_bus_speed(struct controller *ctrl, struct slot *p_slot, enum p | |||
266 | return rc; | 261 | return rc; |
267 | } | 262 | } |
268 | 263 | ||
269 | static u32 fix_bus_speed(struct controller *ctrl, struct slot *pslot, u8 flag, | 264 | static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, |
270 | enum pci_bus_speed asp, enum pci_bus_speed bsp, enum pci_bus_speed msp) | 265 | u8 flag, enum pci_bus_speed asp, enum pci_bus_speed bsp, |
266 | enum pci_bus_speed msp) | ||
271 | { | 267 | { |
272 | u32 rc = 0; | 268 | int rc = 0; |
273 | 269 | ||
274 | if (flag != 0) { /* Other slots on the same bus are occupied */ | 270 | if (flag != 0) { /* Other slots on the same bus are occupied */ |
275 | if ( asp < bsp ) { | 271 | if ( asp < bsp ) { |
@@ -308,11 +304,11 @@ enum pci_bus_speed asp, enum pci_bus_speed bsp, enum pci_bus_speed msp) | |||
308 | * Configures board | 304 | * Configures board |
309 | * | 305 | * |
310 | */ | 306 | */ |
311 | static u32 board_added(struct slot *p_slot) | 307 | static int board_added(struct slot *p_slot) |
312 | { | 308 | { |
313 | u8 hp_slot; | 309 | u8 hp_slot; |
314 | u8 slots_not_empty = 0; | 310 | u8 slots_not_empty = 0; |
315 | u32 rc = 0; | 311 | int rc = 0; |
316 | enum pci_bus_speed adapter_speed, bus_speed, max_bus_speed; | 312 | enum pci_bus_speed adapter_speed, bus_speed, max_bus_speed; |
317 | u8 pi, mode; | 313 | u8 pi, mode; |
318 | struct controller *ctrl = p_slot->ctrl; | 314 | struct controller *ctrl = p_slot->ctrl; |
@@ -580,11 +576,11 @@ err_exit: | |||
580 | * remove_board - Turns off slot and LED's | 576 | * remove_board - Turns off slot and LED's |
581 | * | 577 | * |
582 | */ | 578 | */ |
583 | static u32 remove_board(struct slot *p_slot) | 579 | static int remove_board(struct slot *p_slot) |
584 | { | 580 | { |
585 | struct controller *ctrl = p_slot->ctrl; | 581 | struct controller *ctrl = p_slot->ctrl; |
586 | u8 hp_slot; | 582 | u8 hp_slot; |
587 | u32 rc; | 583 | int rc; |
588 | 584 | ||
589 | if (shpchp_unconfigure_device(p_slot)) | 585 | if (shpchp_unconfigure_device(p_slot)) |
590 | return(1); | 586 | return(1); |
@@ -961,7 +957,6 @@ int shpchp_enable_slot (struct slot *p_slot) | |||
961 | int shpchp_disable_slot (struct slot *p_slot) | 957 | int shpchp_disable_slot (struct slot *p_slot) |
962 | { | 958 | { |
963 | u8 getstatus = 0; | 959 | u8 getstatus = 0; |
964 | u32 rc = 0; | ||
965 | int ret = 0; | 960 | int ret = 0; |
966 | 961 | ||
967 | if (!p_slot->ctrl) | 962 | if (!p_slot->ctrl) |
@@ -990,8 +985,8 @@ int shpchp_disable_slot (struct slot *p_slot) | |||
990 | } | 985 | } |
991 | up(&p_slot->ctrl->crit_sect); | 986 | up(&p_slot->ctrl->crit_sect); |
992 | 987 | ||
993 | rc = remove_board(p_slot); | 988 | ret = remove_board(p_slot); |
994 | update_slot_info(p_slot); | 989 | update_slot_info(p_slot); |
995 | return rc; | 990 | return ret; |
996 | } | 991 | } |
997 | 992 | ||