mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
net: ethernet: stmmac: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
80c5a20b53
commit
abec4be3ee
1 changed files with 10 additions and 12 deletions
|
@ -118,10 +118,9 @@ int tse_pcs_init(void __iomem *base, struct tse_pcs *pcs)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pcs_link_timer_callback(unsigned long data)
|
static void pcs_link_timer_callback(struct tse_pcs *pcs)
|
||||||
{
|
{
|
||||||
u16 val = 0;
|
u16 val = 0;
|
||||||
struct tse_pcs *pcs = (struct tse_pcs *)data;
|
|
||||||
void __iomem *tse_pcs_base = pcs->tse_pcs_base;
|
void __iomem *tse_pcs_base = pcs->tse_pcs_base;
|
||||||
void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base;
|
void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base;
|
||||||
|
|
||||||
|
@ -138,12 +137,11 @@ static void pcs_link_timer_callback(unsigned long data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void auto_nego_timer_callback(unsigned long data)
|
static void auto_nego_timer_callback(struct tse_pcs *pcs)
|
||||||
{
|
{
|
||||||
u16 val = 0;
|
u16 val = 0;
|
||||||
u16 speed = 0;
|
u16 speed = 0;
|
||||||
u16 duplex = 0;
|
u16 duplex = 0;
|
||||||
struct tse_pcs *pcs = (struct tse_pcs *)data;
|
|
||||||
void __iomem *tse_pcs_base = pcs->tse_pcs_base;
|
void __iomem *tse_pcs_base = pcs->tse_pcs_base;
|
||||||
void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base;
|
void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base;
|
||||||
|
|
||||||
|
@ -201,14 +199,14 @@ static void auto_nego_timer_callback(unsigned long data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aneg_link_timer_callback(unsigned long data)
|
static void aneg_link_timer_callback(struct timer_list *t)
|
||||||
{
|
{
|
||||||
struct tse_pcs *pcs = (struct tse_pcs *)data;
|
struct tse_pcs *pcs = from_timer(pcs, t, aneg_link_timer);
|
||||||
|
|
||||||
if (pcs->autoneg == AUTONEG_ENABLE)
|
if (pcs->autoneg == AUTONEG_ENABLE)
|
||||||
auto_nego_timer_callback(data);
|
auto_nego_timer_callback(pcs);
|
||||||
else if (pcs->autoneg == AUTONEG_DISABLE)
|
else if (pcs->autoneg == AUTONEG_DISABLE)
|
||||||
pcs_link_timer_callback(data);
|
pcs_link_timer_callback(pcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev,
|
void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev,
|
||||||
|
@ -237,8 +235,8 @@ void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev,
|
||||||
|
|
||||||
tse_pcs_reset(tse_pcs_base, pcs);
|
tse_pcs_reset(tse_pcs_base, pcs);
|
||||||
|
|
||||||
setup_timer(&pcs->aneg_link_timer,
|
timer_setup(&pcs->aneg_link_timer, aneg_link_timer_callback,
|
||||||
aneg_link_timer_callback, (unsigned long)pcs);
|
0);
|
||||||
mod_timer(&pcs->aneg_link_timer, jiffies +
|
mod_timer(&pcs->aneg_link_timer, jiffies +
|
||||||
msecs_to_jiffies(AUTONEGO_LINK_TIMER));
|
msecs_to_jiffies(AUTONEGO_LINK_TIMER));
|
||||||
} else if (phy_dev->autoneg == AUTONEG_DISABLE) {
|
} else if (phy_dev->autoneg == AUTONEG_DISABLE) {
|
||||||
|
@ -270,8 +268,8 @@ void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev,
|
||||||
|
|
||||||
tse_pcs_reset(tse_pcs_base, pcs);
|
tse_pcs_reset(tse_pcs_base, pcs);
|
||||||
|
|
||||||
setup_timer(&pcs->aneg_link_timer,
|
timer_setup(&pcs->aneg_link_timer, aneg_link_timer_callback,
|
||||||
aneg_link_timer_callback, (unsigned long)pcs);
|
0);
|
||||||
mod_timer(&pcs->aneg_link_timer, jiffies +
|
mod_timer(&pcs->aneg_link_timer, jiffies +
|
||||||
msecs_to_jiffies(AUTONEGO_LINK_TIMER));
|
msecs_to_jiffies(AUTONEGO_LINK_TIMER));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue