Commit 76fa3ce9 authored by Michael Walle's avatar Michael Walle Committed by David S. Miller

enetc: reorder macros and functions

Now that there aren't any more macros with parameters, move the macros
above any functions.
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 652b5dba
...@@ -14,17 +14,6 @@ ...@@ -14,17 +14,6 @@
#define ENETC_MDIO_DATA 0x8 /* MDIO data */ #define ENETC_MDIO_DATA 0x8 /* MDIO data */
#define ENETC_MDIO_ADDR 0xc /* MDIO address */ #define ENETC_MDIO_ADDR 0xc /* MDIO address */
static inline u32 enetc_mdio_rd(struct enetc_mdio_priv *mdio_priv, int off)
{
return enetc_port_rd_mdio(mdio_priv->hw, mdio_priv->mdio_base + off);
}
static inline void enetc_mdio_wr(struct enetc_mdio_priv *mdio_priv, int off,
u32 val)
{
enetc_port_wr_mdio(mdio_priv->hw, mdio_priv->mdio_base + off, val);
}
#define MDIO_CFG_CLKDIV(x) ((((x) >> 1) & 0xff) << 8) #define MDIO_CFG_CLKDIV(x) ((((x) >> 1) & 0xff) << 8)
#define MDIO_CFG_BSY BIT(0) #define MDIO_CFG_BSY BIT(0)
#define MDIO_CFG_RD_ER BIT(1) #define MDIO_CFG_RD_ER BIT(1)
...@@ -42,6 +31,17 @@ static inline void enetc_mdio_wr(struct enetc_mdio_priv *mdio_priv, int off, ...@@ -42,6 +31,17 @@ static inline void enetc_mdio_wr(struct enetc_mdio_priv *mdio_priv, int off,
#define MDIO_CTL_PORT_ADDR(x) (((x) & 0x1f) << 5) #define MDIO_CTL_PORT_ADDR(x) (((x) & 0x1f) << 5)
#define MDIO_CTL_READ BIT(15) #define MDIO_CTL_READ BIT(15)
static inline u32 enetc_mdio_rd(struct enetc_mdio_priv *mdio_priv, int off)
{
return enetc_port_rd_mdio(mdio_priv->hw, mdio_priv->mdio_base + off);
}
static inline void enetc_mdio_wr(struct enetc_mdio_priv *mdio_priv, int off,
u32 val)
{
enetc_port_wr_mdio(mdio_priv->hw, mdio_priv->mdio_base + off, val);
}
static bool enetc_mdio_is_busy(struct enetc_mdio_priv *mdio_priv) static bool enetc_mdio_is_busy(struct enetc_mdio_priv *mdio_priv)
{ {
return enetc_mdio_rd(mdio_priv, ENETC_MDIO_CFG) & MDIO_CFG_BSY; return enetc_mdio_rd(mdio_priv, ENETC_MDIO_CFG) & MDIO_CFG_BSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment