[PATCH -next] net: dsa: mv88e6xxx: use setup_timer to simplify the code

Subsystems: marvell 88e6xxx ethernet switch fabric driver, networking drivers, networking [dsa], the rest

STALE3590d

2 messages, 2 authors, 2016-10-23 · open the first message on its own page

[PATCH -next] net: dsa: mv88e6xxx: use setup_timer to simplify the code

From: Wei Yongjun <hidden>
Date: 2016-10-22 14:28:14

From: Wei Yongjun <redacted>

Use setup_timer function instead of initializing timer with the function
and data fields.

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index ac03297..52d29b8 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)

Re: [PATCH -next] net: dsa: mv88e6xxx: use setup_timer to simplify the code

From: Andrew Lunn <andrew@lunn.ch>
Date: 2016-10-23 15:54:48

On Sat, Oct 22, 2016 at 02:28:00PM +0000, Wei Yongjun wrote:
From: Wei Yongjun <redacted>

Use setup_timer function instead of initializing timer with the function
and data fields.

Signed-off-by: Wei Yongjun <redacted>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help