diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2016-02-10 01:37:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-10 13:38:12 +0300 |
commit | 568b3ce7a8efdc23ad2f0b9ca8d82899cf68972d (patch) | |
tree | 6db5464426e716abcbc9185957873d767334e3c9 /drivers/net/ethernet/renesas/ravb.h | |
parent | ef5c0e253d0bde6e11a7f94e58a68c3b354afc6b (diff) | |
download | linux-568b3ce7a8efdc23ad2f0b9ca8d82899cf68972d.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet/renesas/ravb.h')
-rw-r--r-- | drivers/net/ethernet/renesas/ravb.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h index 9fbe92ac225b..b2160d1b9c71 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -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); |