diff options
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 43bfe7e6b6f5..ed1f9bbb2a32 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -6123,19 +6123,19 @@ static int __devinit niu_pci_probe_sprom(struct niu *np) | |||
6123 | val = nr64(ESPC_PHY_TYPE); | 6123 | val = nr64(ESPC_PHY_TYPE); |
6124 | switch (np->port) { | 6124 | switch (np->port) { |
6125 | case 0: | 6125 | case 0: |
6126 | val = (val & ESPC_PHY_TYPE_PORT0) >> | 6126 | val8 = (val & ESPC_PHY_TYPE_PORT0) >> |
6127 | ESPC_PHY_TYPE_PORT0_SHIFT; | 6127 | ESPC_PHY_TYPE_PORT0_SHIFT; |
6128 | break; | 6128 | break; |
6129 | case 1: | 6129 | case 1: |
6130 | val = (val & ESPC_PHY_TYPE_PORT1) >> | 6130 | val8 = (val & ESPC_PHY_TYPE_PORT1) >> |
6131 | ESPC_PHY_TYPE_PORT1_SHIFT; | 6131 | ESPC_PHY_TYPE_PORT1_SHIFT; |
6132 | break; | 6132 | break; |
6133 | case 2: | 6133 | case 2: |
6134 | val = (val & ESPC_PHY_TYPE_PORT2) >> | 6134 | val8 = (val & ESPC_PHY_TYPE_PORT2) >> |
6135 | ESPC_PHY_TYPE_PORT2_SHIFT; | 6135 | ESPC_PHY_TYPE_PORT2_SHIFT; |
6136 | break; | 6136 | break; |
6137 | case 3: | 6137 | case 3: |
6138 | val = (val & ESPC_PHY_TYPE_PORT3) >> | 6138 | val8 = (val & ESPC_PHY_TYPE_PORT3) >> |
6139 | ESPC_PHY_TYPE_PORT3_SHIFT; | 6139 | ESPC_PHY_TYPE_PORT3_SHIFT; |
6140 | break; | 6140 | break; |
6141 | default: | 6141 | default: |
@@ -6143,9 +6143,9 @@ static int __devinit niu_pci_probe_sprom(struct niu *np) | |||
6143 | np->port); | 6143 | np->port); |
6144 | return -EINVAL; | 6144 | return -EINVAL; |
6145 | } | 6145 | } |
6146 | niudbg(PROBE, "SPROM: PHY type %llx\n", (unsigned long long) val); | 6146 | niudbg(PROBE, "SPROM: PHY type %x\n", val8); |
6147 | 6147 | ||
6148 | switch (val) { | 6148 | switch (val8) { |
6149 | case ESPC_PHY_TYPE_1G_COPPER: | 6149 | case ESPC_PHY_TYPE_1G_COPPER: |
6150 | /* 1G copper, MII */ | 6150 | /* 1G copper, MII */ |
6151 | np->flags &= ~(NIU_FLAGS_FIBER | | 6151 | np->flags &= ~(NIU_FLAGS_FIBER | |
@@ -6175,8 +6175,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np) | |||
6175 | break; | 6175 | break; |
6176 | 6176 | ||
6177 | default: | 6177 | default: |
6178 | dev_err(np->device, PFX "Bogus SPROM phy type %llu\n", | 6178 | dev_err(np->device, PFX "Bogus SPROM phy type %u\n", val8); |
6179 | (unsigned long long) val); | ||
6180 | return -EINVAL; | 6179 | return -EINVAL; |
6181 | } | 6180 | } |
6182 | 6181 | ||
@@ -6213,7 +6212,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np) | |||
6213 | val = nr64(ESPC_MOD_STR_LEN); | 6212 | val = nr64(ESPC_MOD_STR_LEN); |
6214 | niudbg(PROBE, "SPROM: MOD_STR_LEN[%llu]\n", | 6213 | niudbg(PROBE, "SPROM: MOD_STR_LEN[%llu]\n", |
6215 | (unsigned long long) val); | 6214 | (unsigned long long) val); |
6216 | if (val > 8 * 4) | 6215 | if (val >= 8 * 4) |
6217 | return -EINVAL; | 6216 | return -EINVAL; |
6218 | 6217 | ||
6219 | for (i = 0; i < val; i += 4) { | 6218 | for (i = 0; i < val; i += 4) { |
@@ -6229,7 +6228,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np) | |||
6229 | val = nr64(ESPC_BD_MOD_STR_LEN); | 6228 | val = nr64(ESPC_BD_MOD_STR_LEN); |
6230 | niudbg(PROBE, "SPROM: BD_MOD_STR_LEN[%llu]\n", | 6229 | niudbg(PROBE, "SPROM: BD_MOD_STR_LEN[%llu]\n", |
6231 | (unsigned long long) val); | 6230 | (unsigned long long) val); |
6232 | if (val > 4 * 4) | 6231 | if (val >= 4 * 4) |
6233 | return -EINVAL; | 6232 | return -EINVAL; |
6234 | 6233 | ||
6235 | for (i = 0; i < val; i += 4) { | 6234 | for (i = 0; i < val; i += 4) { |