aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-11-10 10:34:52 -0500
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-11-10 10:34:52 -0500
commit6c78935777d12ead2d32adf3eb525a24faf02d04 (patch)
treebab2ebe155d92ca535af6c2ff10287667beb8355
parente4a67df75a7b93b1bcddf576fa9122da2305dc8b (diff)
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 <keescook@chromium.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: David Lechner <david@lechnology.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Sean Paul <seanpaul@chromium.org> Cc: Jean Delvare <jdelvare@suse.de> Cc: Hans de Goede <hdegoede@redhat.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com> [b.zolnierkie: ported it over pxa3xx_gcu changes] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-rw-r--r--drivers/video/fbdev/aty/radeon_base.c8
-rw-r--r--drivers/video/fbdev/core/fbcon.c10
-rw-r--r--drivers/video/fbdev/core/fbcon.h1
-rw-r--r--drivers/video/fbdev/omap/hwa742.c6
-rw-r--r--drivers/video/fbdev/omap2/omapfb/dss/dsi.c6
5 files changed, 13 insertions, 18 deletions
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 8ad1643e7d1c..4d77daeecf99 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -1454,9 +1454,9 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
1454/* 1454/*
1455 * Timer function for delayed LVDS panel power up/down 1455 * Timer function for delayed LVDS panel power up/down
1456 */ 1456 */
1457static void radeon_lvds_timer_func(unsigned long data) 1457static void radeon_lvds_timer_func(struct timer_list *t)
1458{ 1458{
1459 struct radeonfb_info *rinfo = (struct radeonfb_info *)data; 1459 struct radeonfb_info *rinfo = from_timer(rinfo, t, lvds_timer);
1460 1460
1461 radeon_engine_idle(); 1461 radeon_engine_idle();
1462 1462
@@ -2291,9 +2291,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
2291 rinfo->pdev = pdev; 2291 rinfo->pdev = pdev;
2292 2292
2293 spin_lock_init(&rinfo->reg_lock); 2293 spin_lock_init(&rinfo->reg_lock);
2294 init_timer(&rinfo->lvds_timer); 2294 timer_setup(&rinfo->lvds_timer, radeon_lvds_timer_func, 0);
2295 rinfo->lvds_timer.function = radeon_lvds_timer_func;
2296 rinfo->lvds_timer.data = (unsigned long)rinfo;
2297 2295
2298 c1 = ent->device >> 8; 2296 c1 = ent->device >> 8;
2299 c2 = ent->device & 0xff; 2297 c2 = ent->device & 0xff;
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 04612f938bab..3b4a96379128 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -395,10 +395,10 @@ static void fb_flashcursor(struct work_struct *work)
395 console_unlock(); 395 console_unlock();
396} 396}
397 397
398static void cursor_timer_handler(unsigned long dev_addr) 398static void cursor_timer_handler(struct timer_list *t)
399{ 399{
400 struct fb_info *info = (struct fb_info *) dev_addr; 400 struct fbcon_ops *ops = from_timer(ops, t, cursor_timer);
401 struct fbcon_ops *ops = info->fbcon_par; 401 struct fb_info *info = ops->info;
402 402
403 queue_work(system_power_efficient_wq, &info->queue); 403 queue_work(system_power_efficient_wq, &info->queue);
404 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); 404 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
@@ -414,8 +414,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
414 if (!info->queue.func) 414 if (!info->queue.func)
415 INIT_WORK(&info->queue, fb_flashcursor); 415 INIT_WORK(&info->queue, fb_flashcursor);
416 416
417 setup_timer(&ops->cursor_timer, cursor_timer_handler, 417 timer_setup(&ops->cursor_timer, cursor_timer_handler, 0);
418 (unsigned long) info);
419 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies); 418 mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
420 ops->flags |= FBCON_FLAGS_CURSOR_TIMER; 419 ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
421 } 420 }
@@ -714,6 +713,7 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info,
714 713
715 if (!err) { 714 if (!err) {
716 ops->cur_blink_jiffies = HZ / 5; 715 ops->cur_blink_jiffies = HZ / 5;
716 ops->info = info;
717 info->fbcon_par = ops; 717 info->fbcon_par = ops;
718 718
719 if (vc) 719 if (vc)
diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h
index 18f3ac144237..9f7744fbc962 100644
--- a/drivers/video/fbdev/core/fbcon.h
+++ b/drivers/video/fbdev/core/fbcon.h
@@ -69,6 +69,7 @@ struct fbcon_ops {
69 struct timer_list cursor_timer; /* Cursor timer */ 69 struct timer_list cursor_timer; /* Cursor timer */
70 struct fb_cursor cursor_state; 70 struct fb_cursor cursor_state;
71 struct display *p; 71 struct display *p;
72 struct fb_info *info;
72 int currcon; /* Current VC. */ 73 int currcon; /* Current VC. */
73 int cur_blink_jiffies; 74 int cur_blink_jiffies;
74 int cursor_flash; 75 int cursor_flash;
diff --git a/drivers/video/fbdev/omap/hwa742.c b/drivers/video/fbdev/omap/hwa742.c
index a4ee65b8f918..6199d4806193 100644
--- a/drivers/video/fbdev/omap/hwa742.c
+++ b/drivers/video/fbdev/omap/hwa742.c
@@ -474,7 +474,7 @@ static void auto_update_complete(void *data)
474 jiffies + HWA742_AUTO_UPDATE_TIME); 474 jiffies + HWA742_AUTO_UPDATE_TIME);
475} 475}
476 476
477static void hwa742_update_window_auto(unsigned long arg) 477static void hwa742_update_window_auto(struct timer_list *unused)
478{ 478{
479 LIST_HEAD(req_list); 479 LIST_HEAD(req_list);
480 struct hwa742_request *last; 480 struct hwa742_request *last;
@@ -1002,9 +1002,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
1002 hwa742.auto_update_window.height = fbdev->panel->y_res; 1002 hwa742.auto_update_window.height = fbdev->panel->y_res;
1003 hwa742.auto_update_window.format = 0; 1003 hwa742.auto_update_window.format = 0;
1004 1004
1005 init_timer(&hwa742.auto_update_timer); 1005 timer_setup(&hwa742.auto_update_timer, hwa742_update_window_auto, 0);
1006 hwa742.auto_update_timer.function = hwa742_update_window_auto;
1007 hwa742.auto_update_timer.data = 0;
1008 1006
1009 hwa742.prev_color_mode = -1; 1007 hwa742.prev_color_mode = -1;
1010 hwa742.prev_flags = 0; 1008 hwa742.prev_flags = 0;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index 30d49f3800b3..8e1d60d48dbb 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -3988,7 +3988,7 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev)
3988} 3988}
3989 3989
3990#ifdef DSI_CATCH_MISSING_TE 3990#ifdef DSI_CATCH_MISSING_TE
3991static void dsi_te_timeout(unsigned long arg) 3991static void dsi_te_timeout(struct timer_list *unused)
3992{ 3992{
3993 DSSERR("TE not received for 250ms!\n"); 3993 DSSERR("TE not received for 250ms!\n");
3994} 3994}
@@ -5298,9 +5298,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
5298 dsi_framedone_timeout_work_callback); 5298 dsi_framedone_timeout_work_callback);
5299 5299
5300#ifdef DSI_CATCH_MISSING_TE 5300#ifdef DSI_CATCH_MISSING_TE
5301 init_timer(&dsi->te_timer); 5301 timer_setup(&dsi->te_timer, dsi_te_timeout, 0);
5302 dsi->te_timer.function = dsi_te_timeout;
5303 dsi->te_timer.data = 0;
5304#endif 5302#endif
5305 5303
5306 res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto"); 5304 res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "proto");