Skip to contentSkip to conversation

staging: visorbus, replace init_timer with setup_timer

PATCH In review Jiri Slaby 2 participants 2 messages Feb 15, 2017 Staging

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 staging: visorbus, replace init_timer with setup_timer

From: Stefan Svinciak <[email protected]>

Newer version is more readable and needs less changes if/when timer_struct is to be changed.

---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/unisys/visorbus/visorbus_main.c +1 -3
index aea1aa262b28..55f29ae8e015 100644
@@ -623,9 +623,7 @@ create_visor_device(struct visor_device *dev)
 	dev->device.release = visorbus_release_device;
 	/* keep a reference just for us (now 2) */
 	get_device(&dev->device);
-	init_timer(&dev->timer);
-	dev->timer.data = (unsigned long)(dev);
-	dev->timer.function = dev_periodic_work;
+	setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev);
 
 	/*
 	 * bus_id must be a unique name with respect to this bus TYPE
Signature · 1 line
2.11.1
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines

-----Original Message-----
From: Jiri Slaby [mailto:[email protected]]
Sent: Wednesday, February 15, 2017 11:04 AM
To: Kershner, David A <[email protected]>
Cc: [email protected]; Stefan Svinciak <[email protected]>; Jiri Slaby <[email protected]>; Greg Kroah-Hartman <[email protected]>; *S-Par-Maintainer <[email protected]>; [email protected]
Subject: [PATCH] staging: visorbus, replace init_timer with setup_timer

From: Stefan Svinciak <[email protected]>

Newer version is more readable and needs less changes if/when timer_struct is to be changed.

Quoted 6 lines

Looks good and runs nicely on s-Par.

David Kershner

Quoted 22 lines
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/unisys/visorbus/visorbus_main.c +1 -4
index aea1aa262b28..55f29ae8e015 100644
@@ -623,9 +623,7 @@ create_visor_device(struct visor_device *dev)
 	dev->device.release = visorbus_release_device;
 	/* keep a reference just for us (now 2) */
 	get_device(&dev->device);
-	init_timer(&dev->timer);
-	dev->timer.data = (unsigned long)(dev);
-	dev->timer.function = dev_periodic_work;
+	setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev);
 
 	/*
 	 * bus_id must be a unique name with respect to this bus TYPE
--

2.11.1