summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-10-22 14:28:00 +0000
committerDavid S. Miller <davem@davemloft.net>2016-10-26 17:21:59 -0400
commit68497a87c4f4f918cbbdbae88652e796c75e11bd (patch)
tree891fca9606aacb8e8f55501a6689ade5e91442bf
parent1aaa87aff688bbb47e9ab36c638e1bb876810a39 (diff)
downloadlinux-68497a87c4f4f918cbbdbae88652e796c75e11bd.tar.gz
linux-68497a87c4f4f918cbbdbae88652e796c75e11bd.tar.bz2
linux-68497a87c4f4f918cbbdbae88652e796c75e11bd.zip
net: dsa: mv88e6xxx: use setup_timer to simplify the code
Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 157360f25069..72b9dac29901 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -639,9 +639,8 @@ static void mv88e6xxx_ppu_state_init(struct mv88e6xxx_chip *chip)
{
mutex_init(&chip->ppu_mutex);
INIT_WORK(&chip->ppu_work, mv88e6xxx_ppu_reenable_work);
- init_timer(&chip->ppu_timer);
- chip->ppu_timer.data = (unsigned long)chip;
- chip->ppu_timer.function = mv88e6xxx_ppu_reenable_timer;
+ setup_timer(&chip->ppu_timer, mv88e6xxx_ppu_reenable_timer,
+ (unsigned long)chip);
}
static void mv88e6xxx_ppu_state_destroy(struct mv88e6xxx_chip *chip)