Staging: w35und: simplify error handling in wb35_hw_init()
authorPekka Enberg <penberg@cs.helsinki.fi>
Wed, 8 Apr 2009 08:13:58 +0000 (11:13 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Jun 2009 18:00:37 +0000 (11:00 -0700)
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: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/winbond/wbusb.c

index e91d611ad95fd2d2ce1ca283d5bd7e10b2fb4aae..897ac94f63afad32b3ab437c01319d4395e2e709 100644 (file)
@@ -476,7 +476,7 @@ static void hal_led_control(unsigned long data)
        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 hw_data * pHwData = &priv->sHwData;
@@ -514,13 +514,13 @@ static u8 hal_init_hardware(struct ieee80211_hw *hw)
                                Wb35Rx_start(hw);
                                Wb35Tx_EP2VM_start(priv);
 
-                               return true;
+                               return 0;
                        }
                }
        }
 
        pHwData->SurpriseRemove = 1;
-       return false;
+       return -EINVAL;
 }
 
 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
        pHwData = &priv->sHwData;
-       if (!hal_init_hardware(hw)) {
-               err = -EINVAL;
+       err = hal_init_hardware(hw);
+       if (err)
                goto error;
-       }
 
        EEPROM_region = hal_get_region_from_EEPROM( pHwData );
        if (EEPROM_region != REGION_AUTO)