diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-09-15 04:30:14 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-17 13:06:25 -0400 |
commit | 385e24917ed8eeba25dddd8e63bf3fe3d53eafc5 (patch) | |
tree | 8ab67402844702e534d9d0684fbb49db75883383 /drivers/pci/hotplug/pciehp_hpc.c | |
parent | 6aaa6d06f57f3689afe27c1fad256c5d6aa9b271 (diff) |
PCI: pciehp: remove pci_dev field
Since we have a pointer to pcie_device in struct controller, we don't
need a pointer to pci_dev.
Acked-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index b1dcf9aa80b..3867d9c47eb 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -44,25 +44,25 @@ static atomic_t pciehp_num_controllers = ATOMIC_INIT(0); | |||
44 | 44 | ||
45 | static inline int pciehp_readw(struct controller *ctrl, int reg, u16 *value) | 45 | static inline int pciehp_readw(struct controller *ctrl, int reg, u16 *value) |
46 | { | 46 | { |
47 | struct pci_dev *dev = ctrl->pci_dev; | 47 | struct pci_dev *dev = ctrl->pcie->port; |
48 | return pci_read_config_word(dev, ctrl->cap_base + reg, value); | 48 | return pci_read_config_word(dev, ctrl->cap_base + reg, value); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline int pciehp_readl(struct controller *ctrl, int reg, u32 *value) | 51 | static inline int pciehp_readl(struct controller *ctrl, int reg, u32 *value) |
52 | { | 52 | { |
53 | struct pci_dev *dev = ctrl->pci_dev; | 53 | struct pci_dev *dev = ctrl->pcie->port; |
54 | return pci_read_config_dword(dev, ctrl->cap_base + reg, value); | 54 | return pci_read_config_dword(dev, ctrl->cap_base + reg, value); |
55 | } | 55 | } |
56 | 56 | ||
57 | static inline int pciehp_writew(struct controller *ctrl, int reg, u16 value) | 57 | static inline int pciehp_writew(struct controller *ctrl, int reg, u16 value) |
58 | { | 58 | { |
59 | struct pci_dev *dev = ctrl->pci_dev; | 59 | struct pci_dev *dev = ctrl->pcie->port; |
60 | return pci_write_config_word(dev, ctrl->cap_base + reg, value); | 60 | return pci_write_config_word(dev, ctrl->cap_base + reg, value); |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline int pciehp_writel(struct controller *ctrl, int reg, u32 value) | 63 | static inline int pciehp_writel(struct controller *ctrl, int reg, u32 value) |
64 | { | 64 | { |
65 | struct pci_dev *dev = ctrl->pci_dev; | 65 | struct pci_dev *dev = ctrl->pcie->port; |
66 | return pci_write_config_dword(dev, ctrl->cap_base + reg, value); | 66 | return pci_write_config_dword(dev, ctrl->cap_base + reg, value); |
67 | } | 67 | } |
68 | 68 | ||
@@ -537,7 +537,7 @@ static int hpc_power_on_slot(struct slot * slot) | |||
537 | 537 | ||
538 | static inline int pcie_mask_bad_dllp(struct controller *ctrl) | 538 | static inline int pcie_mask_bad_dllp(struct controller *ctrl) |
539 | { | 539 | { |
540 | struct pci_dev *dev = ctrl->pci_dev; | 540 | struct pci_dev *dev = ctrl->pcie->port; |
541 | int pos; | 541 | int pos; |
542 | u32 reg; | 542 | u32 reg; |
543 | 543 | ||
@@ -554,7 +554,7 @@ static inline int pcie_mask_bad_dllp(struct controller *ctrl) | |||
554 | 554 | ||
555 | static inline void pcie_unmask_bad_dllp(struct controller *ctrl) | 555 | static inline void pcie_unmask_bad_dllp(struct controller *ctrl) |
556 | { | 556 | { |
557 | struct pci_dev *dev = ctrl->pci_dev; | 557 | struct pci_dev *dev = ctrl->pcie->port; |
558 | u32 reg; | 558 | u32 reg; |
559 | int pos; | 559 | int pos; |
560 | 560 | ||
@@ -946,7 +946,7 @@ static inline void dbg_ctrl(struct controller *ctrl) | |||
946 | { | 946 | { |
947 | int i; | 947 | int i; |
948 | u16 reg16; | 948 | u16 reg16; |
949 | struct pci_dev *pdev = ctrl->pci_dev; | 949 | struct pci_dev *pdev = ctrl->pcie->port; |
950 | 950 | ||
951 | if (!pciehp_debug) | 951 | if (!pciehp_debug) |
952 | return; | 952 | return; |
@@ -1004,7 +1004,6 @@ struct controller *pcie_init(struct pcie_device *dev) | |||
1004 | goto abort; | 1004 | goto abort; |
1005 | } | 1005 | } |
1006 | ctrl->pcie = dev; | 1006 | ctrl->pcie = dev; |
1007 | ctrl->pci_dev = pdev; | ||
1008 | ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 1007 | ctrl->cap_base = pci_find_capability(pdev, PCI_CAP_ID_EXP); |
1009 | if (!ctrl->cap_base) { | 1008 | if (!ctrl->cap_base) { |
1010 | ctrl_err(ctrl, "Cannot find PCI Express capability\n"); | 1009 | ctrl_err(ctrl, "Cannot find PCI Express capability\n"); |