Commit 1de86387 authored by Kees Cook's avatar Kees Cook Committed by Daniel Vetter

drm: gma500: 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.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171024151609.GA104501@beast
parent 85b4587f
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include "psb_intel_reg.h" #include "psb_intel_reg.h"
#include <linux/spinlock.h> #include <linux/spinlock.h>
static void psb_lid_timer_func(unsigned long data) static void psb_lid_timer_func(struct timer_list *t)
{ {
struct drm_psb_private * dev_priv = (struct drm_psb_private *)data; struct drm_psb_private *dev_priv = from_timer(dev_priv, t, lid_timer);
struct drm_device *dev = (struct drm_device *)dev_priv->dev; struct drm_device *dev = (struct drm_device *)dev_priv->dev;
struct timer_list *lid_timer = &dev_priv->lid_timer; struct timer_list *lid_timer = &dev_priv->lid_timer;
unsigned long irq_flags; unsigned long irq_flags;
...@@ -77,10 +77,8 @@ void psb_lid_timer_init(struct drm_psb_private *dev_priv) ...@@ -77,10 +77,8 @@ void psb_lid_timer_init(struct drm_psb_private *dev_priv)
spin_lock_init(&dev_priv->lid_lock); spin_lock_init(&dev_priv->lid_lock);
spin_lock_irqsave(&dev_priv->lid_lock, irq_flags); spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);
init_timer(lid_timer); timer_setup(lid_timer, psb_lid_timer_func, 0);
lid_timer->data = (unsigned long)dev_priv;
lid_timer->function = psb_lid_timer_func;
lid_timer->expires = jiffies + PSB_LID_DELAY; lid_timer->expires = jiffies + PSB_LID_DELAY;
add_timer(lid_timer); add_timer(lid_timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment