diff options
author | Salah Triki <salah.triki@acm.org> | 2016-05-04 04:42:41 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-18 19:49:02 -0700 |
commit | 6ceb65b83771ec860478061479ba54b7093c2ee2 (patch) | |
tree | 46319379211c196ef787b9b8ee88d01861852804 /drivers | |
parent | 2fe9262e7e024b089d6f1962fe1fa06b383d2991 (diff) | |
download | blackbird-op-linux-6ceb65b83771ec860478061479ba54b7093c2ee2.tar.gz blackbird-op-linux-6ceb65b83771ec860478061479ba54b7093c2ee2.zip |
staging: rtl8192u: propagate errors in eprom_read
Propagate error from eprom_r and change the return type of eprom_read
from u32 to int.
Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192u/r8180_93cx6.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8180_93cx6.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c index 2c53132e79cf..f35defc36fd9 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.c +++ b/drivers/staging/rtl8192u/r8180_93cx6.c @@ -106,7 +106,7 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len) } -u32 eprom_read(struct net_device *dev, u32 addr) +int eprom_read(struct net_device *dev, u32 addr) { struct r8192_priv *priv = ieee80211_priv(dev); short read_cmd[] = {1, 1, 0}; @@ -114,6 +114,7 @@ u32 eprom_read(struct net_device *dev, u32 addr) int i; int addr_len; u32 ret; + int err; ret = 0; /* enable EPROM programming */ @@ -157,7 +158,11 @@ u32 eprom_read(struct net_device *dev, u32 addr) * and reading data. (eeprom outs a dummy 0) */ eprom_ck_cycle(dev); - ret |= (eprom_r(dev)<<(15-i)); + err = eprom_r(dev); + if (err < 0) + return err; + + ret |= err<<(15-i); } eprom_cs(dev, 0); diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h b/drivers/staging/rtl8192u/r8180_93cx6.h index b840348eb5e3..9cf7f587c3ab 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.h +++ b/drivers/staging/rtl8192u/r8180_93cx6.h @@ -40,4 +40,4 @@ #define EPROM_TXPW1 0x3d -u32 eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */ +int eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */ |