Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ceb65b8 authored by Salah Triki's avatar Salah Triki Committed by Greg Kroah-Hartman
Browse files

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: default avatarSalah Triki <salah.triki@acm.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2fe9262e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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 */