Rename sm_retries as sm_fault_retries, as this is what this member is tracking.
Unified · Split
| @@ -234,7 +234,7 @@ struct sfp { · 233 unmodified lines | |||
| 234 | unsigned char sm_mod_tries; | 234 | unsigned char sm_mod_tries; |
| 235 | unsigned char sm_dev_state; | 235 | unsigned char sm_dev_state; |
| 236 | unsigned short sm_state; | 236 | unsigned short sm_state; |
| 237 | unsigned int sm_retries; | 237 | unsigned char sm_fault_retries; |
| 238 | 238 | ||
| 239 | struct sfp_eeprom_id id; | 239 | struct sfp_eeprom_id id; |
| 240 | unsigned int module_power_mW; | 240 | unsigned int module_power_mW; |
| @@ -1490,7 +1490,7 @@ static bool sfp_los_event_inactive(struct sfp *sfp, unsigned int event) · 1249 unmodified lines | |||
| 1490 | 1490 | ||
| 1491 | static void sfp_sm_fault(struct sfp *sfp, unsigned int next_state, bool warn) | 1491 | static void sfp_sm_fault(struct sfp *sfp, unsigned int next_state, bool warn) |
| 1492 | { | 1492 | { |
| 1493 | if (sfp->sm_retries && !--sfp->sm_retries) { | 1493 | if (sfp->sm_fault_retries && !--sfp->sm_fault_retries) { |
| 1494 | dev_err(sfp->dev, | 1494 | dev_err(sfp->dev, |
| 1495 | "module persistently indicates fault, disabling\n"); | 1495 | "module persistently indicates fault, disabling\n"); |
| 1496 | sfp_sm_next(sfp, SFP_S_TX_DISABLE, 0); | 1496 | sfp_sm_next(sfp, SFP_S_TX_DISABLE, 0); |
| @@ -1893,7 +1893,7 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event) · 396 unmodified lines | |||
| 1893 | sfp_module_tx_enable(sfp); | 1893 | sfp_module_tx_enable(sfp); |
| 1894 | 1894 | ||
| 1895 | /* Initialise the fault clearance retries */ | 1895 | /* Initialise the fault clearance retries */ |
| 1896 | sfp->sm_retries = N_FAULT_INIT; | 1896 | sfp->sm_fault_retries = N_FAULT_INIT; |
| 1897 | 1897 | ||
| 1898 | /* We need to check the TX_FAULT state, which is not defined | 1898 | /* We need to check the TX_FAULT state, which is not defined |
| 1899 | * while TX_DISABLE is asserted. The earliest we want to do | 1899 | * while TX_DISABLE is asserted. The earliest we want to do |
| @@ -1933,7 +1933,7 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event) · 33 unmodified lines | |||
| 1933 | * or t_start_up, so assume there is a fault. | 1933 | * or t_start_up, so assume there is a fault. |
| 1934 | */ | 1934 | */ |
| 1935 | sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, | 1935 | sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, |
| 1936 | sfp->sm_retries == N_FAULT_INIT); | 1936 | sfp->sm_fault_retries == N_FAULT_INIT); |
| 1937 | } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { | 1937 | } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { |
| 1938 | init_done: /* TX_FAULT deasserted or we timed out with TX_FAULT | 1938 | init_done: /* TX_FAULT deasserted or we timed out with TX_FAULT |
| 1939 | * clear. Probe for the PHY and check the LOS state. | 1939 | * clear. Probe for the PHY and check the LOS state. |
| @@ -1946,7 +1946,7 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event) · 6 unmodified lines | |||
| 1946 | sfp_sm_link_check_los(sfp); | 1946 | sfp_sm_link_check_los(sfp); |
| 1947 | 1947 | ||
| 1948 | /* Reset the fault retry count */ | 1948 | /* Reset the fault retry count */ |
| 1949 | sfp->sm_retries = N_FAULT; | 1949 | sfp->sm_fault_retries = N_FAULT; |
| 1950 | } | 1950 | } |
| 1951 | break; | 1951 | break; |
| 1952 | 1952 | ||