rt2x00: Respect return values
Subsystems (3)
PATCH 6/10 rt2x00: Respect return values
Respect the return values given from various functions. The return code should be handed upstream and not replaced by some other (possibly wrong) error code.
Signed-off-by Ivo van Doorn <[email protected]>
---
drivers/net/wireless/d80211/rt2x00/rt2400pci.c +8 -4
@@ -2937,6 +2937,7 @@ {struct net_device *net_dev =pci_get_drvdata (pci_dev);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Going to sleep.\n" );
@@ -2948,8 +2949,9 @@/* * Set device mode to sleep for power management. */ -if (rt2400pci_set_state (rt2x00dev,STATE_SLEEP )) -return -EBUSY ; + status =rt2400pci_set_state (rt2x00dev,STATE_SLEEP ); +if (status) +return status;/* * Uninitialize device.
@@ -2973,6 +2975,7 @@ {struct net_device *net_dev =pci_get_drvdata (pci_dev);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Waking up.\n" );
@@ -2989,9 +2992,10 @@/* * Initialize hardware. */ -if (rt2400pci_alloc_dev (pci_dev, net_dev)) { + status =rt2400pci_alloc_dev (pci_dev, net_dev); +if (status) {ERROR ("Failed to allocate device.\n" ); -return -ENOMEM ; +return status; }/*
drivers/net/wireless/d80211/rt2x00/rt2500pci.c +8 -4
@@ -3222,6 +3222,7 @@ {struct net_device *net_dev =pci_get_drvdata (pci_dev);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Going to sleep.\n" );
@@ -3233,8 +3234,9 @@/* * Set device mode to sleep for power management. */ -if (rt2500pci_set_state (rt2x00dev,STATE_SLEEP )) -return -EBUSY ; + status =rt2500pci_set_state (rt2x00dev,STATE_SLEEP ); +if (status) +return status;/* * Uninitialize device.
@@ -3258,6 +3260,7 @@ {struct net_device *net_dev =pci_get_drvdata (pci_dev);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Waking up.\n" );
@@ -3274,9 +3277,10 @@/* * Initialize hardware. */ -if (rt2500pci_alloc_dev (pci_dev, net_dev)) { + status =rt2500pci_alloc_dev (pci_dev, net_dev); +if (status) {ERROR ("Failed to allocate device.\n" ); -return -ENOMEM ; +return status; }/*
drivers/net/wireless/d80211/rt2x00/rt2500usb.c +8 -4
@@ -2839,6 +2839,7 @@ {struct net_device *net_dev =usb_get_intfdata (usb_intf);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Going to sleep.\n" );
@@ -2850,8 +2851,9 @@/* * Set device mode to sleep for power management. */ -if (rt2500usb_set_state (rt2x00dev,STATE_SLEEP )) -return -EBUSY ; + status =rt2500usb_set_state (rt2x00dev,STATE_SLEEP ); +if (status) +return status;/* * Uninitialize device.
@@ -2875,6 +2877,7 @@ {struct net_device *net_dev =usb_get_intfdata (usb_intf);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Waking up.\n" );
@@ -2886,9 +2889,10 @@/* * Initialize hardware. */ -if (rt2500usb_alloc_dev (usb_intf, net_dev)) { + status =rt2500usb_alloc_dev (usb_intf, net_dev); +if (status) {ERROR ("Failed to allocate device.\n" ); -return -ENOMEM ; +return status; }/*
drivers/net/wireless/d80211/rt2x00/rt61pci.c +8 -4
@@ -3739,6 +3739,7 @@ {struct net_device *net_dev =pci_get_drvdata (pci_dev);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Going to sleep.\n" );
@@ -3750,8 +3751,9 @@/* * Set device mode to sleep for power management. */ -if (rt61pci_set_state (rt2x00dev,STATE_SLEEP )) -return -EBUSY ; + status =rt61pci_set_state (rt2x00dev,STATE_SLEEP ); +if (status) +return status;/* * Uninitialize device.
@@ -3775,6 +3777,7 @@ {struct net_device *net_dev =pci_get_drvdata (pci_dev);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Waking up.\n" );
@@ -3791,9 +3794,10 @@/* * Initialize hardware. */ -if (rt61pci_alloc_dev (pci_dev, net_dev)) { + status =rt61pci_alloc_dev (pci_dev, net_dev); +if (status) {ERROR ("Failed to allocate device.\n" ); -return -ENOMEM ; +return status; }/*
drivers/net/wireless/d80211/rt2x00/rt73usb.c +8 -4
@@ -3204,6 +3204,7 @@ {struct net_device *net_dev =usb_get_intfdata (usb_intf);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Going to sleep.\n" );
@@ -3215,8 +3216,9 @@/* * Set device mode to sleep for power management. */ -if (rt73usb_set_state (rt2x00dev,STATE_SLEEP )) -return -EBUSY ; + status =rt73usb_set_state (rt2x00dev,STATE_SLEEP ); +if (status) +return status;/* * Uninitialize device.
@@ -3240,6 +3242,7 @@ {struct net_device *net_dev =usb_get_intfdata (usb_intf);struct rt2x00_dev *rt2x00dev =ieee80211_dev_hw_data (net_dev); +int status;NOTICE ("Waking up.\n" );
@@ -3251,9 +3254,10 @@/* * Initialize hardware. */ -if (rt73usb_alloc_dev (usb_intf, net_dev)) { + status =rt73usb_alloc_dev (usb_intf, net_dev); +if (status) {ERROR ("Failed to allocate device.\n" ); -return -ENOMEM ; +return status; }/*