mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-27 08:05:27 +08:00
net: ks8851: Use 16-bit read of RXFC register
The RXFC register is the only one being read using 8-bit accessors. To make it easier to support the 16-bit accesses used by the parallel bus variant of KS8851, use 16-bit accessor to read RXFC register as well as neighboring RXFCTR register. Remove ks8851_rdreg8() as it is not used anywhere anymore. There should be no functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: David S. Miller <davem@davemloft.net> Cc: Lukas Wunner <lukas@wunner.de> Cc: Petr Stetiar <ynezz@true.cz> Cc: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
88cfedd0d7
commit
aa39bf6730
@ -236,21 +236,6 @@ static void ks8851_rdreg(struct ks8851_net *ks, unsigned op,
|
||||
memcpy(rxb, trx + 2, rxl);
|
||||
}
|
||||
|
||||
/**
|
||||
* ks8851_rdreg8 - read 8 bit register from device
|
||||
* @ks: The chip information
|
||||
* @reg: The register address
|
||||
*
|
||||
* Read a 8bit register from the chip, returning the result
|
||||
*/
|
||||
static unsigned ks8851_rdreg8(struct ks8851_net *ks, unsigned reg)
|
||||
{
|
||||
u8 rxb[1];
|
||||
|
||||
ks8851_rdreg(ks, MK_OP(1 << (reg & 3), reg), rxb, 1);
|
||||
return rxb[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* ks8851_rdreg16 - read 16 bit register from device
|
||||
* @ks: The chip information
|
||||
@ -470,7 +455,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
|
||||
unsigned rxstat;
|
||||
u8 *rxpkt;
|
||||
|
||||
rxfc = ks8851_rdreg8(ks, KS_RXFC);
|
||||
rxfc = (ks8851_rdreg16(ks, KS_RXFCTR) >> 8) & 0xff;
|
||||
|
||||
netif_dbg(ks, rx_status, ks->netdev,
|
||||
"%s: %d packets\n", __func__, rxfc);
|
||||
|
Loading…
Reference in New Issue
Block a user