linux/drivers/staging
Xenia Ragiadakou b3d42bf187 staging: rtl8192u: fix read_nic_* functions
read_nic_*() functions are defined in r8192U_core.c.
They call internally usb_control_msg() to read the
nic registers and return the value read.
Following a remark made by Dan Carpenter, if usb_control_msg()
fails, the value returned will be invalid.

To accommodate for this, this patch changes the functions
to take a pointer as argument to set the value read and
return 0 on success and the error status on failure, so
that callers of read_nic_*() can check the return status.

Some other fixes introduced in read_nic_*() functions are:

The expressions (1<<EPROM_*_SHIFT) used to address and set
the individual bits of the eeprom register were replaced
with EPROM_*_BIT bitmasks to make the code more intuitive.
EPROM_*_BIT bitmasks were defined in r8192U_hw.h and
EPROM_*_SHIFT were removed.

In netdev_err(), which is called in case of failure,
the hardcoded function name in the error log message was
replaced with __func__ to reduce line size.
Also, from the error log message, it was omitted the word
"Timeout" and it is just reported the error code since the
failure can not only be due to timeout expiration but also
due to a memory allocation failure. In case of timeout
expiration, usb_start_wait_urb() prints an appropriate log
message when debug is enabled.

Finally, some minor fixes to the coding style were applied in
lines affected by the above changes, including the removal
of ifdef DEBUG_RX (the debugging of reads and writes of the
nic registers shall be done with explicit check on their
return status which will be added in a follow on patch).

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 11:57:16 -07:00
..
android staging: android: sync: fix up a sparse warning 2013-06-04 15:59:23 -07:00
asus_oled staging/asus_oled fixed linebreak and printk issue 2013-06-05 15:29:07 -07:00
bcm Staging: bcm: fix checkpatch errors and warnings in Version.h 2013-05-21 19:59:50 -07:00
btmtk_usb staging: btmtk_usb: use GFP_KERNEL inplace of GFP_ATOMIC in _probe path 2013-06-03 12:35:53 -07:00
ced1401 Staging: ced1401: Staticize local symbols 2013-05-22 15:31:39 -07:00
comedi staging: comedi: pcmda12: tidy up multi-line comments 2013-06-05 15:35:39 -07:00
cptm1217 staging: cptm1217: don't call input_free_device() after input_unregister_device() 2013-05-13 17:50:05 -04:00
crystalhd Staging: crystalhd: remove an unneeded NULL check 2013-06-03 12:26:18 -07:00
csr Staging: csr: fix indentation style issue in bh.c 2013-05-30 21:09:57 +09:00
cxt1e1 Staging/cxt1e1:Removing parantheses surrounding return argument 2013-05-22 15:28:30 -07:00
dgrp staging: for dgrp, let nd_ps_desc always NUL terminated string within MAX_DESC_LEN length 2013-05-13 18:08:16 -04:00
dwc2 staging: dwc2: remove redundant D0 power state set 2013-06-03 12:29:55 -07:00
echo staging: echo: Fixed camel-case variable names 2013-05-13 13:39:31 -07:00
et131x staging: et131x: cancel_work when module gets unloaded 2013-04-11 13:07:05 -07:00
frontier staging/frontier: Fixed up incorrect formatted comments 2013-05-21 10:30:10 -07:00
ft1000 staging: fixed else format in ft1000_debug.c 2013-05-17 15:54:57 -07:00
fwserial staging: fwserial: Use normal logging styles 2013-05-30 20:59:47 +09:00
gdm72xx staging: gdm72xx: fix typos in Kconfig 2013-06-05 15:31:16 -07:00
goldfish staging/goldfish: Fixed up incorrect formatted comments. 2013-05-21 10:30:10 -07:00
iio Merge 3.10-rc3 into staging-next 2013-05-27 10:54:33 +09:00
imx-drm staging: drm/imx: revert vsync_cnt for di->id 1 2013-05-30 21:02:07 +09:00
keucr keucr: fix some alignment- and whitespace-problems 2013-06-06 11:48:50 -07:00
line6 staging: line6: pod.c: fix checkpatch warning 2013-03-11 09:47:13 -07:00
lustre staging/lustre/libcfs: cleanup libcfs_kkuc_msg_put a bit 2013-06-06 11:44:39 -07:00
media staging/solo6x10: depend on CONFIG_FONTS 2013-05-16 15:37:50 -07:00
netlogic Staging: netlogic: remove unused variable in xlr_net_start_xmit() 2013-03-14 15:03:56 -07:00
nvec Merge 3.10-rc3 into staging-next 2013-05-27 10:54:33 +09:00
octeon
octeon-usb staging: octeon-usb: remove duplicated include from octeon-hcd.c 2013-06-05 15:35:59 -07:00
olpc_dcon staging: olpc_dcon: return NOTIFY_DONE instead of the 0. 2013-03-25 11:02:55 -07:00
ozwpan Revert "ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c" 2013-06-04 16:03:22 -07:00
panel Staging: Panel: panel: Fixed checkpatch line length warnings 2013-05-16 16:01:46 -07:00
phison
quickstart
rtl8187se staging: single_open() leaks 2013-05-05 00:15:43 -04:00
rtl8192e Staging: rtl8192e: fix an endian bug 2013-05-30 20:46:29 +09:00
rtl8192u staging: rtl8192u: fix read_nic_* functions 2013-06-06 11:57:16 -07:00
rtl8712 rtl8712: remove redundant if statement 2013-03-11 09:49:55 -07:00
rts5139 staging: rts5139: Use correct USB transfer interval to fix syslog spamming 2013-06-03 12:15:34 -07:00
sb105x staging/sb105x: remove asm/segment.h dependency 2013-05-16 16:01:46 -07:00
sbe-2t3e3
sep staging: sep: fix driver build and kconfig 2013-05-16 15:37:49 -07:00
serqt_usb2 TTY: add tty_port_tty_wakeup helper 2013-03-18 16:19:45 -07:00
silicom staging/silicom/bypasslib: Move opening brace to previous line 2013-05-30 21:03:32 +09:00
slicoss staging: slicoss: fix error return code in slic_entry_probe() 2013-05-13 18:02:28 -04:00
sm7xxfb staging/sm7xxfb: Convert to SIMPLE_DEV_PM_OPS 2013-03-11 09:23:43 -07:00
speakup staging: speakup: fix warnings by adding __user annotations 2013-05-22 15:35:52 -07:00
ste_rmi4 staging: ste_rmi4: Suppress 'ignoring return value of ‘regulator_enable()' warning 2013-05-16 15:37:49 -07:00
ti-soc-thermal staging: ti-soc-thermal: remove external heat while extrapolating hotspot 2013-05-13 18:02:30 -04:00
tidspbridge Staging: tidspbridge: _tiomap.h: fixed indentation warning. 2013-05-21 19:57:39 -07:00
usbip staging: usbip: Renaming pr_warning function 2013-05-13 13:39:31 -07:00
vme staging: vme: fix error return code in vme_user_probe() 2013-05-13 17:34:22 -04:00
vt6655 Staging: vt6655: add missing free_netdev() on error in hostap_enable_hostapd() 2013-05-30 20:46:26 +09:00
vt6656 staging: vt6656: rf.c: Remove camel case from local variables 2013-05-30 21:09:05 +09:00
winbond Staging: winbond: Check for unsuccessful allocation immediately 2013-06-03 12:32:00 -07:00
wlags49_h2 staging: wlags49_h2: fix error return code in wl_adapter_insert() 2013-05-17 15:05:07 -07:00
wlags49_h25
wlan-ng wlan-ng: replace calls to kmalloc and memcpy with kmemdup 2013-05-13 14:01:26 -07:00
xgifb staging: xgifb: vb_setmode: delete IF_DEF_CRT2Monitor checks 2013-05-30 20:55:53 +09:00
zcache staging: ramster: add how-to document 2013-05-20 08:21:04 -07:00
zram Staging: Fixes string split across lines in zram 2013-05-20 10:43:11 -07:00
zsmalloc staging/zsmalloc: Fixed up incorrect formatted comments 2013-05-21 10:30:10 -07:00
Kconfig staging: MIPS: add Octeon USB HCD support 2013-06-03 12:45:03 -07:00
Makefile staging: MIPS: add Octeon USB HCD support 2013-06-03 12:45:03 -07:00
staging.c