diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-11-16 02:37:38 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-02-11 10:32:16 -0500 |
commit | 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (patch) | |
tree | 5a5456b00c1a0bc5f9a7571539266783fd8ae8a6 /drivers/net/e1000/e1000_main.c | |
parent | 09dde54c6a69d4f9ea1213923b93aeae7020f8b6 (diff) |
e1000: Fix for 32 bits platforms with 64 bits resources
The e1000 driver stores the content of the PCI resources into
unsigned long's before ioremapping. This breaks on 32 bits
platforms that support 64 bits MMIO resources such as ppc 44x.
This fixes it by removing those temporary variables and passing
directly the result of pci_resource_start/len to ioremap.
The side effect is that I removed the assignments to the netdev
fields mem_start, mem_end and base_addr, which are totally useless
for PCI devices.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
--
drivers/net/e1000/e1000_main.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 7c5b05a82f0e..d4ee8ec34b56 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -926,8 +926,6 @@ e1000_probe(struct pci_dev *pdev, | |||
926 | { | 926 | { |
927 | struct net_device *netdev; | 927 | struct net_device *netdev; |
928 | struct e1000_adapter *adapter; | 928 | struct e1000_adapter *adapter; |
929 | unsigned long mmio_start, mmio_len; | ||
930 | unsigned long flash_start, flash_len; | ||
931 | 929 | ||
932 | static int cards_found = 0; | 930 | static int cards_found = 0; |
933 | static int global_quad_port_a = 0; /* global ksp3 port a indication */ | 931 | static int global_quad_port_a = 0; /* global ksp3 port a indication */ |
@@ -970,11 +968,9 @@ e1000_probe(struct pci_dev *pdev, | |||
970 | adapter->hw.back = adapter; | 968 | adapter->hw.back = adapter; |
971 | adapter->msg_enable = (1 << debug) - 1; | 969 | adapter->msg_enable = (1 << debug) - 1; |
972 | 970 | ||
973 | mmio_start = pci_resource_start(pdev, BAR_0); | ||
974 | mmio_len = pci_resource_len(pdev, BAR_0); | ||
975 | |||
976 | err = -EIO; | 971 | err = -EIO; |
977 | adapter->hw.hw_addr = ioremap(mmio_start, mmio_len); | 972 | adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, BAR_0), |
973 | pci_resource_len(pdev, BAR_0)); | ||
978 | if (!adapter->hw.hw_addr) | 974 | if (!adapter->hw.hw_addr) |
979 | goto err_ioremap; | 975 | goto err_ioremap; |
980 | 976 | ||
@@ -1009,10 +1005,6 @@ e1000_probe(struct pci_dev *pdev, | |||
1009 | #endif | 1005 | #endif |
1010 | strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); | 1006 | strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); |
1011 | 1007 | ||
1012 | netdev->mem_start = mmio_start; | ||
1013 | netdev->mem_end = mmio_start + mmio_len; | ||
1014 | netdev->base_addr = adapter->hw.io_base; | ||
1015 | |||
1016 | adapter->bd_number = cards_found; | 1008 | adapter->bd_number = cards_found; |
1017 | 1009 | ||
1018 | /* setup the private structure */ | 1010 | /* setup the private structure */ |
@@ -1025,9 +1017,9 @@ e1000_probe(struct pci_dev *pdev, | |||
1025 | * because it depends on mac_type */ | 1017 | * because it depends on mac_type */ |
1026 | if ((adapter->hw.mac_type == e1000_ich8lan) && | 1018 | if ((adapter->hw.mac_type == e1000_ich8lan) && |
1027 | (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { | 1019 | (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { |
1028 | flash_start = pci_resource_start(pdev, 1); | 1020 | adapter->hw.flash_address = |
1029 | flash_len = pci_resource_len(pdev, 1); | 1021 | ioremap(pci_resource_start(pdev, 1), |
1030 | adapter->hw.flash_address = ioremap(flash_start, flash_len); | 1022 | pci_resource_len(pdev, 1)); |
1031 | if (!adapter->hw.flash_address) | 1023 | if (!adapter->hw.flash_address) |
1032 | goto err_flashmap; | 1024 | goto err_flashmap; |
1033 | } | 1025 | } |