提交 bffa8fc3 编写于 作者: S Stephen Rothwell

powerpc: remove ISERIES_[SUB]BUS macros

This allows us to simplify a couple of things.
Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
上级 426c1a11
...@@ -31,10 +31,9 @@ ...@@ -31,10 +31,9 @@
#include <asm/tce.h> #include <asm/tce.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
#include <asm/pci-bridge.h>
#include <asm/iSeries/HvCallXm.h> #include <asm/iSeries/HvCallXm.h>
#include "pci.h"
extern struct list_head iSeries_Global_Device_List; extern struct list_head iSeries_Global_Device_List;
...@@ -114,7 +113,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl) ...@@ -114,7 +113,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
* 2. TCE table per Bus. * 2. TCE table per Bus.
* 3. TCE Table per IOA. * 3. TCE Table per IOA.
*/ */
static void iommu_table_getparms(struct device_node *dn, static void iommu_table_getparms(struct pci_dn *pdn,
struct iommu_table* tbl) struct iommu_table* tbl)
{ {
struct iommu_table_cb *parms; struct iommu_table_cb *parms;
...@@ -125,8 +124,8 @@ static void iommu_table_getparms(struct device_node *dn, ...@@ -125,8 +124,8 @@ static void iommu_table_getparms(struct device_node *dn,
memset(parms, 0, sizeof(*parms)); memset(parms, 0, sizeof(*parms));
parms->itc_busno = ISERIES_BUS(dn); parms->itc_busno = pdn->DsaAddr.Dsa.busNumber;
parms->itc_slotno = PCI_DN(dn)->LogicalSlot; parms->itc_slotno = pdn->LogicalSlot;
parms->itc_virtbus = 0; parms->itc_virtbus = 0;
HvCallXm_getTceTableParms(iseries_hv_addr(parms)); HvCallXm_getTceTableParms(iseries_hv_addr(parms));
...@@ -153,7 +152,7 @@ void iommu_devnode_init_iSeries(struct device_node *dn) ...@@ -153,7 +152,7 @@ void iommu_devnode_init_iSeries(struct device_node *dn)
tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL); tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
iommu_table_getparms(dn, tbl); iommu_table_getparms(pdn, tbl);
/* Look for existing tce table */ /* Look for existing tce table */
pdn->iommu_table = iommu_table_find(tbl); pdn->iommu_table = iommu_table_find(tbl);
......
...@@ -30,17 +30,8 @@ ...@@ -30,17 +30,8 @@
* End Change Activity * End Change Activity
*/ */
#include <asm/pci-bridge.h>
struct pci_dev; /* For Forward Reference */ struct pci_dev; /* For Forward Reference */
/*
* Gets iSeries Bus, SubBus, DevFn using device_node structure
*/
#define ISERIES_BUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.busNumber
#define ISERIES_SUBBUS(DevPtr) PCI_DN(DevPtr)->DsaAddr.Dsa.subBusNumber
/* /*
* Decodes Linux DevFn to iSeries DevFn, bridge device, or function. * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
* For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <asm/types.h> #include <asm/types.h>
#include <asm/resource.h> #include <asm/resource.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
#include <asm/pci-bridge.h>
#include <asm/iSeries/HvCallPci.h> #include <asm/iSeries/HvCallPci.h>
#include <asm/iSeries/HvTypes.h> #include <asm/iSeries/HvTypes.h>
...@@ -243,6 +244,7 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, ...@@ -243,6 +244,7 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
{ {
struct device_node *DevNode = PciDev->sysdata; struct device_node *DevNode = PciDev->sysdata;
struct pci_dn *pdn;
u16 bus; u16 bus;
u8 frame; u8 frame;
char card[4]; char card[4];
...@@ -255,8 +257,9 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count) ...@@ -255,8 +257,9 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
return; return;
} }
bus = ISERIES_BUS(DevNode); pdn = PCI_DN(DevNode);
subbus = ISERIES_SUBBUS(DevNode); bus = pdn->DsaAddr.Dsa.busNumber;
subbus = pdn->DsaAddr.Dsa.subBusNumber;
agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
iSeries_Get_Location_Code(bus, agent, &frame, card); iSeries_Get_Location_Code(bus, agent, &frame, card);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册