From 940bd8bb25e037a31ba1cf26d8535bdb24c3723e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 1 Jun 2016 21:58:32 -0700 Subject: e1000: Convert E1000_*_REG macros to functions E1000_*_REG don't bring any value by being macros and implicit appending of "E1000_" prefix to the constant name only makes thing harder to grep or understand. Replace those macros with functions. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- drivers/net/e1000/e1000.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers/net/e1000/e1000.h') diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 19faf0bdee..7c5c98b9eb 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -28,18 +28,6 @@ #define DEBUGFUNC() do { } while (0) #endif -/* I/O wrapper functions */ -#define E1000_WRITE_REG(a, reg, value) \ - writel((value), ((a)->hw_addr + E1000_##reg)) -#define E1000_READ_REG(a, reg) \ - readl((a)->hw_addr + E1000_##reg) -#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) \ - writel((value), ((a)->hw_addr + E1000_##reg + ((offset) << 2))) -#define E1000_READ_REG_ARRAY(a, reg, offset) \ - readl((a)->hw_addr + E1000_##reg + ((offset) << 2)) -#define E1000_WRITE_FLUSH(a) \ - do { E1000_READ_REG(a, STATUS); } while (0) - /* Enumerated types specific to the e1000 hardware */ /* Media Access Controlers */ typedef enum { @@ -2128,6 +2116,16 @@ struct e1000_hw { int rx_tail, rx_last; }; +void e1000_write_reg(struct e1000_hw *hw, uint32_t reg, + uint32_t value); +uint32_t e1000_read_reg(struct e1000_hw *hw, uint32_t reg); +uint32_t e1000_read_reg_array(struct e1000_hw *hw, + uint32_t base, uint32_t idx); +void e1000_write_reg_array(struct e1000_hw *hw, uint32_t base, + uint32_t idx, uint32_t value); + +void e1000_write_flush(struct e1000_hw *hw); + int32_t e1000_init_eeprom_params(struct e1000_hw *hw); int e1000_validate_eeprom_checksum(struct e1000_hw *hw); int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t offset, -- cgit v1.2.3