Skip to content

Commit

Permalink
platform/witherspoon: Remove PHB4_SHARED_SLOT_IDX_WITHERSPOON constant
Browse files Browse the repository at this point in the history
PHB4_SHARED_SLOT_IDX_WITHERSPOON is the index of the PHB which the
shared slot is connected to rather than the index of the shared slot
which the name suggests. This is confusing at best so this patch
replaces the only usages of this macro with just the PHB number
and a comment.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Sep 5, 2017
1 parent 9727fe3 commit e6b5d60
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions platforms/astbmc/witherspoon.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ static void dt_create_npu2(void)
}
}

#define PHB4_SHARED_SLOT_IDX_WITHERSPOON 3

static bool witherspoon_probe(void)
{
if (!dt_node_is_compatible(dt_root, "ibm,witherspoon"))
Expand Down Expand Up @@ -384,10 +382,10 @@ static void phb4_pre_pci_fixup_witherspoon(void)
"Unexpected number of chips, skipping shared slot detection\n");
return;
}
slot0 = pci_slot_find(phb4_get_opal_id(chip0->id,
PHB4_SHARED_SLOT_IDX_WITHERSPOON));
slot1 = pci_slot_find(phb4_get_opal_id(chip1->id,
PHB4_SHARED_SLOT_IDX_WITHERSPOON));

/* the shared slot is connected to PHB3 on both chips */
slot0 = pci_slot_find(phb4_get_opal_id(chip0->id, 3));
slot1 = pci_slot_find(phb4_get_opal_id(chip1->id, 3));
if (slot0 && slot1) {
if (slot0->ops.get_presence_state)
slot0->ops.get_presence_state(slot0, &p0);
Expand Down

0 comments on commit e6b5d60

Please sign in to comment.