]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/vkms: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:26 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:06 +0000 (11:19 +0100)
hrtimer_setup() takes the callback function pointer as argument and
initializes the timer completely.

Replace hrtimer_init() and the open coded initialization of
hrtimer::function with the new setup mechanism.

Patch was created by using Coccinelle.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/866841803c850c38819f98fdf6bd992ee4a4d012.1738746904.git.namcao@linutronix.de
drivers/gpu/drm/vkms/vkms_crtc.c

index 28a57ae109fcc05af3fe74f94518c462c09119e3..ae4e36bc337c4682b579310b95c501cc7006806a 100644 (file)
@@ -64,8 +64,8 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)
        struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
        struct vkms_output *out = drm_crtc_to_vkms_output(crtc);
 
-       hrtimer_init(&out->vblank_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       out->vblank_hrtimer.function = &vkms_vblank_simulate;
+       hrtimer_setup(&out->vblank_hrtimer, &vkms_vblank_simulate, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
        out->period_ns = ktime_set(0, vblank->framedur_ns);
        hrtimer_start(&out->vblank_hrtimer, out->period_ns, HRTIMER_MODE_REL);