Skip to content

Commit 6c78935

Browse files
keesbzolnier
authored andcommitted
video: fbdev: 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. One tracking pointer was added. Signed-off-by: Kees Cook <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: David Lechner <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Sean Paul <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Hans de Goede <[email protected]> Cc: "Gustavo A. R. Silva" <[email protected]> [b.zolnierkie: ported it over pxa3xx_gcu changes] Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
1 parent e4a67df commit 6c78935

File tree

5 files changed

+13
-18
lines changed

5 files changed

+13
-18
lines changed

drivers/video/fbdev/aty/radeon_base.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,9 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
14541454
/*
14551455
* Timer function for delayed LVDS panel power up/down
14561456
*/
1457-
static void radeon_lvds_timer_func(unsigned long data)
1457+
static void radeon_lvds_timer_func(struct timer_list *t)
14581458
{
1459-
struct radeonfb_info *rinfo = (struct radeonfb_info *)data;
1459+
struct radeonfb_info *rinfo = from_timer(rinfo, t, lvds_timer);
14601460

14611461
radeon_engine_idle();
14621462

@@ -2291,9 +2291,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
22912291
rinfo->pdev = pdev;
22922292

22932293
spin_lock_init(&rinfo->reg_lock);
2294-
init_timer(&rinfo->lvds_timer);
2295-
rinfo->lvds_timer.function = radeon_lvds_timer_func;
2296-
rinfo->lvds_timer.data = (unsigned long)rinfo;
2294+
timer_setup(&rinfo->lvds_timer, radeon_lvds_timer_func, 0);
22972295

22982296
c1 = ent->device >> 8;
22992297
c2 = ent->device & 0xff;

drivers/video/fbdev/core/fbcon.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,10 @@ static void fb_flashcursor(struct work_struct *work)
395395
console_unlock();
396396
}
397397

398-
static void cursor_timer_handler(unsigned long dev_addr)
398+
static void cursor_timer_handler(struct timer_list *t)
399399
{
400-
struct fb_info *info = (struct fb_info *) dev_addr;
401-
struct fbcon_ops *ops = info->fbcon_par;
400+
struct fbcon_ops *ops = from_timer(ops, t, cursor_timer);
401+
struct fb_info *info = ops->info;
402402

403403
queue_work(system_power_efficient_wq, &info->queue);
404404
mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
@@ -414,8 +414,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
414414
if (!info->queue.func)
415415
INIT_WORK(&info->queue, fb_flashcursor);
416416

417-
setup_timer(&ops->cursor_timer, cursor_timer_handler,
418-
(unsigned long) info);
417+
timer_setup(&ops->cursor_timer, cursor_timer_handler, 0);
419418
mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
420419
ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
421420
}
@@ -714,6 +713,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
714713

715714
if (!err) {
716715
ops->cur_blink_jiffies = HZ / 5;
716+
ops->info = info;
717717
info->fbcon_par = ops;
718718

719719
if (vc)

drivers/video/fbdev/core/fbcon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct fbcon_ops {
6969
struct timer_list cursor_timer; /* Cursor timer */
7070
struct fb_cursor cursor_state;
7171
struct display *p;
72+
struct fb_info *info;
7273
int currcon; /* Current VC. */
7374
int cur_blink_jiffies;
7475
int cursor_flash;

drivers/video/fbdev/omap/hwa742.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static void auto_update_complete(void *data)
474474
jiffies + HWA742_AUTO_UPDATE_TIME);
475475
}
476476

477-
static void hwa742_update_window_auto(unsigned long arg)
477+
static void hwa742_update_window_auto(struct timer_list *unused)
478478
{
479479
LIST_HEAD(req_list);
480480
struct hwa742_request *last;
@@ -1002,9 +1002,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
10021002
hwa742.auto_update_window.height = fbdev->panel->y_res;
10031003
hwa742.auto_update_window.format = 0;
10041004

1005-
init_timer(&hwa742.auto_update_timer);
1006-
hwa742.auto_update_timer.function = hwa742_update_window_auto;
1007-
hwa742.auto_update_timer.data = 0;
1005+
timer_setup(&hwa742.auto_update_timer, hwa742_update_window_auto, 0);
10081006

10091007
hwa742.prev_color_mode = -1;
10101008
hwa742.prev_flags = 0;

drivers/video/fbdev/omap2/omapfb/dss/dsi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,7 +3988,7 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev)
39883988
}
39893989

39903990
#ifdef DSI_CATCH_MISSING_TE
3991-
static void dsi_te_timeout(unsigned long arg)
3991+
static void dsi_te_timeout(struct timer_list *unused)
39923992
{
39933993
DSSERR("TE not received for 250ms!\n");
39943994
}
@@ -5298,9 +5298,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
52985298
dsi_framedone_timeout_work_callback);
52995299

53005300
#ifdef DSI_CATCH_MISSING_TE
5301-
init_timer(&dsi->te_timer);
5302-
dsi->te_timer.function = dsi_te_timeout;
5303-
dsi->te_timer.data = 0;
5301+
timer_setup(&dsi->te_timer, dsi_te_timeout, 0);
53045302
#endif
53055303

53065304
res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto");

0 commit comments

Comments
 (0)