ravb: factor out register bit twiddling code
The driver has often repeated pattern of reading a register, AND'ing and/or OR'ing some bits and writing the value back. Factor the pattern out into ravb_modify() -- this saves 260 bytes of code with ARM gcc 4.7.3. While at it, update Cogent Embedded's copyrights. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ef5c0e253d
commit
568b3ce7a8
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Copyright (C) 2014-2015 Renesas Electronics Corporation
|
||||
* Copyright (C) 2015 Renesas Solutions Corp.
|
||||
* Copyright (C) 2015 Cogent Embedded, Inc. <source@cogentembedded.com>
|
||||
* Copyright (C) 2015-2016 Cogent Embedded, Inc. <source@cogentembedded.com>
|
||||
*
|
||||
* Based on the SuperH Ethernet driver
|
||||
*
|
||||
@@ -837,6 +837,8 @@ static inline void ravb_write(struct net_device *ndev, u32 data,
|
||||
iowrite32(data, priv->addr + reg);
|
||||
}
|
||||
|
||||
void ravb_modify(struct net_device *ndev, enum ravb_reg reg, u32 clear,
|
||||
u32 set);
|
||||
int ravb_wait(struct net_device *ndev, enum ravb_reg reg, u32 mask, u32 value);
|
||||
|
||||
irqreturn_t ravb_ptp_interrupt(struct net_device *ndev);
|
||||
|
Reference in New Issue
Block a user