Commit cfe31f81 authored by Pekka Enberg's avatar Pekka Enberg Committed by Greg Kroah-Hartman

Staging: w35und: simplify error handling in wb35_hw_init()

Impact: cleanup

Change hal_init_hardware() to return an error code rather than a boolean
to simplify error handling in wb35_hw_init().
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 80767e6e
...@@ -476,7 +476,7 @@ static void hal_led_control(unsigned long data) ...@@ -476,7 +476,7 @@ static void hal_led_control(unsigned long data)
add_timer(&pHwData->LEDTimer); add_timer(&pHwData->LEDTimer);
} }
static u8 hal_init_hardware(struct ieee80211_hw *hw) static int hal_init_hardware(struct ieee80211_hw *hw)
{ {
struct wbsoft_priv *priv = hw->priv; struct wbsoft_priv *priv = hw->priv;
struct hw_data * pHwData = &priv->sHwData; struct hw_data * pHwData = &priv->sHwData;
...@@ -514,13 +514,13 @@ static u8 hal_init_hardware(struct ieee80211_hw *hw) ...@@ -514,13 +514,13 @@ static u8 hal_init_hardware(struct ieee80211_hw *hw)
Wb35Rx_start(hw); Wb35Rx_start(hw);
Wb35Tx_EP2VM_start(priv); Wb35Tx_EP2VM_start(priv);
return true; return 0;
} }
} }
} }
pHwData->SurpriseRemove = 1; pHwData->SurpriseRemove = 1;
return false; return -EINVAL;
} }
static int wb35_hw_init(struct ieee80211_hw *hw) static int wb35_hw_init(struct ieee80211_hw *hw)
...@@ -555,10 +555,9 @@ static int wb35_hw_init(struct ieee80211_hw *hw) ...@@ -555,10 +555,9 @@ static int wb35_hw_init(struct ieee80211_hw *hw)
// Initial USB hal // Initial USB hal
pHwData = &priv->sHwData; pHwData = &priv->sHwData;
if (!hal_init_hardware(hw)) { err = hal_init_hardware(hw);
err = -EINVAL; if (err)
goto error; goto error;
}
EEPROM_region = hal_get_region_from_EEPROM( pHwData ); EEPROM_region = hal_get_region_from_EEPROM( pHwData );
if (EEPROM_region != REGION_AUTO) if (EEPROM_region != REGION_AUTO)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment