net: ethernet: apple: 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: "David S. Miller" <davem@davemloft.net> Cc: Johannes Berg <johannes.berg@intel.com> Cc: Jarod Wilson <jarod@redhat.com> Cc: Rob Herring <robh@kernel.org> Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
1128612532
commit
de892f8f2c
@@ -86,7 +86,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id);
|
||||
static irqreturn_t mace_txdma_intr(int irq, void *dev_id);
|
||||
static irqreturn_t mace_rxdma_intr(int irq, void *dev_id);
|
||||
static void mace_set_timeout(struct net_device *dev);
|
||||
static void mace_tx_timeout(unsigned long data);
|
||||
static void mace_tx_timeout(struct timer_list *t);
|
||||
static inline void dbdma_reset(volatile struct dbdma_regs __iomem *dma);
|
||||
static inline void mace_clean_rings(struct mace_data *mp);
|
||||
static void __mace_set_address(struct net_device *dev, void *addr);
|
||||
@@ -196,7 +196,7 @@ static int mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
|
||||
|
||||
memset((char *) mp->tx_cmds, 0,
|
||||
(NCMDS_TX*N_TX_RING + N_RX_RING + 2) * sizeof(struct dbdma_cmd));
|
||||
init_timer(&mp->tx_timeout);
|
||||
timer_setup(&mp->tx_timeout, mace_tx_timeout, 0);
|
||||
spin_lock_init(&mp->lock);
|
||||
mp->timeout_active = 0;
|
||||
|
||||
@@ -521,8 +521,6 @@ static inline void mace_set_timeout(struct net_device *dev)
|
||||
if (mp->timeout_active)
|
||||
del_timer(&mp->tx_timeout);
|
||||
mp->tx_timeout.expires = jiffies + TX_TIMEOUT;
|
||||
mp->tx_timeout.function = mace_tx_timeout;
|
||||
mp->tx_timeout.data = (unsigned long) dev;
|
||||
add_timer(&mp->tx_timeout);
|
||||
mp->timeout_active = 1;
|
||||
}
|
||||
@@ -801,10 +799,10 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void mace_tx_timeout(unsigned long data)
|
||||
static void mace_tx_timeout(struct timer_list *t)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *) data;
|
||||
struct mace_data *mp = netdev_priv(dev);
|
||||
struct mace_data *mp = from_timer(mp, t, tx_timeout);
|
||||
struct net_device *dev = macio_get_drvdata(mp->mdev);
|
||||
volatile struct mace __iomem *mb = mp->mace;
|
||||
volatile struct dbdma_regs __iomem *td = mp->tx_dma;
|
||||
volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
|
||||
|
Reference in New Issue
Block a user