diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-11-25 07:02:13 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-12-04 18:55:26 -0500 |
commit | 2dd60e96b4d52bccd2dd585e776a3449d7b34b8f (patch) | |
tree | 917f339b7542be53ec3b64c12a221d5e6700eec1 /drivers/pci | |
parent | 52a0f24beabe9e89223e367c65a0156dff17265c (diff) |
PCI: portdrv: remove redundant pcie type calculation
PCIe port type is already stored in 'pcie_type' field of struct
pci_dev. So we don't need to get it from pci configuration space.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 7ea37c075d7e..42b21eec15f0 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
@@ -291,19 +291,15 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq) | |||
291 | int pcie_port_device_register(struct pci_dev *dev) | 291 | int pcie_port_device_register(struct pci_dev *dev) |
292 | { | 292 | { |
293 | struct pcie_port_data *port_data; | 293 | struct pcie_port_data *port_data; |
294 | int status, capabilities, irq_mode, i, nr_serv, pos; | 294 | int status, capabilities, irq_mode, i, nr_serv; |
295 | int vectors[PCIE_PORT_DEVICE_MAXSERVICES]; | 295 | int vectors[PCIE_PORT_DEVICE_MAXSERVICES]; |
296 | u16 reg16; | ||
297 | 296 | ||
298 | port_data = kzalloc(sizeof(*port_data), GFP_KERNEL); | 297 | port_data = kzalloc(sizeof(*port_data), GFP_KERNEL); |
299 | if (!port_data) | 298 | if (!port_data) |
300 | return -ENOMEM; | 299 | return -ENOMEM; |
301 | pci_set_drvdata(dev, port_data); | 300 | pci_set_drvdata(dev, port_data); |
302 | 301 | ||
303 | /* Get port type */ | 302 | port_data->port_type = dev->pcie_type; |
304 | pos = pci_pcie_cap(dev); | ||
305 | pci_read_config_word(dev, pos + PCIE_CAPABILITIES_REG, ®16); | ||
306 | port_data->port_type = (reg16 >> 4) & PORT_TYPE_MASK; | ||
307 | 303 | ||
308 | capabilities = get_port_device_capability(dev); | 304 | capabilities = get_port_device_capability(dev); |
309 | /* Root ports are capable of generating PME too */ | 305 | /* Root ports are capable of generating PME too */ |