Skip to content

Commit

Permalink
shpchp: remove shpchprm_get_physical_slot_number
Browse files Browse the repository at this point in the history
This patch removes unnecessary shpchprm_get_physical_slot_number()
function.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kenji Kaneshige authored and Greg Kroah-Hartman committed Dec 20, 2006
1 parent 227b84c commit 6f39be2
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions drivers/pci/hotplug/shpchp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,31 +104,13 @@ static void make_slot_name(struct slot *slot)
slot->bus, slot->number);
}




static int
shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun,
u8 busnum, u8 devnum)
{
int offset = devnum - ctrl->slot_device_offset;

dbg("%s: ctrl->slot_num_inc %d, offset %d\n", __FUNCTION__,
ctrl->slot_num_inc, offset);
*sun = (u8) (ctrl->first_slot + ctrl->slot_num_inc *offset);
return 0;
}



static int init_slots(struct controller *ctrl)
{
struct slot *slot;
struct hotplug_slot *hotplug_slot;
struct hotplug_slot_info *info;
int retval = -ENOMEM;
int i;
u32 sun;

for (i = 0; i < ctrl->num_slots; i++) {
slot = kzalloc(sizeof(*slot), GFP_KERNEL);
Expand All @@ -152,13 +134,8 @@ static int init_slots(struct controller *ctrl)
slot->bus = ctrl->pci_dev->subordinate->number;
slot->device = ctrl->slot_device_offset + i;
slot->hpc_ops = ctrl->hpc_ops;
slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i);
mutex_init(&slot->lock);

if (shpchprm_get_physical_slot_number(ctrl, &sun,
slot->bus, slot->device))
goto error_info;

slot->number = sun;
INIT_DELAYED_WORK(&slot->work, queue_pushbutton_work);

/* register this slot with the hotplug pci core */
Expand Down

0 comments on commit 6f39be2

Please sign in to comment.