drm/etnaviv: 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: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: etnaviv@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
Kees Cook 2017-10-12 16:21:12 -07:00
parent d5272003b8
commit 43b7052426
1 changed files with 3 additions and 4 deletions

View File

@ -975,9 +975,9 @@ static void hangcheck_timer_reset(struct etnaviv_gpu *gpu)
round_jiffies_up(jiffies + DRM_ETNAVIV_HANGCHECK_JIFFIES)); round_jiffies_up(jiffies + DRM_ETNAVIV_HANGCHECK_JIFFIES));
} }
static void hangcheck_handler(unsigned long data) static void hangcheck_handler(struct timer_list *t)
{ {
struct etnaviv_gpu *gpu = (struct etnaviv_gpu *)data; struct etnaviv_gpu *gpu = from_timer(gpu, t, hangcheck_timer);
u32 fence = gpu->completed_fence; u32 fence = gpu->completed_fence;
bool progress = false; bool progress = false;
@ -1648,8 +1648,7 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master,
INIT_WORK(&gpu->recover_work, recover_worker); INIT_WORK(&gpu->recover_work, recover_worker);
init_waitqueue_head(&gpu->fence_event); init_waitqueue_head(&gpu->fence_event);
setup_deferrable_timer(&gpu->hangcheck_timer, hangcheck_handler, timer_setup(&gpu->hangcheck_timer, hangcheck_handler, TIMER_DEFERRABLE);
(unsigned long)gpu);
priv->gpu[priv->num_gpus++] = gpu; priv->gpu[priv->num_gpus++] = gpu;