Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: typec: tcpm: Switch to use hrtimer_setup()

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/7fd2a1f72b3833e1fb36f56f2b28a08c1e64f47e.1738746904.git.namcao@linutronix.de

authored by

Nam Cao and committed by
Thomas Gleixner
9fdf17c5 8073d9df

+8 -8
+8 -8
drivers/usb/typec/tcpm/tcpm.c
··· 7721 7721 kthread_init_work(&port->event_work, tcpm_pd_event_handler); 7722 7722 kthread_init_work(&port->enable_frs, tcpm_enable_frs_work); 7723 7723 kthread_init_work(&port->send_discover_work, tcpm_send_discover_work); 7724 - hrtimer_init(&port->state_machine_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 7725 - port->state_machine_timer.function = state_machine_timer_handler; 7726 - hrtimer_init(&port->vdm_state_machine_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 7727 - port->vdm_state_machine_timer.function = vdm_state_machine_timer_handler; 7728 - hrtimer_init(&port->enable_frs_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 7729 - port->enable_frs_timer.function = enable_frs_timer_handler; 7730 - hrtimer_init(&port->send_discover_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 7731 - port->send_discover_timer.function = send_discover_timer_handler; 7724 + hrtimer_setup(&port->state_machine_timer, state_machine_timer_handler, CLOCK_MONOTONIC, 7725 + HRTIMER_MODE_REL); 7726 + hrtimer_setup(&port->vdm_state_machine_timer, vdm_state_machine_timer_handler, 7727 + CLOCK_MONOTONIC, HRTIMER_MODE_REL); 7728 + hrtimer_setup(&port->enable_frs_timer, enable_frs_timer_handler, CLOCK_MONOTONIC, 7729 + HRTIMER_MODE_REL); 7730 + hrtimer_setup(&port->send_discover_timer, send_discover_timer_handler, CLOCK_MONOTONIC, 7731 + HRTIMER_MODE_REL); 7732 7732 7733 7733 spin_lock_init(&port->pd_event_lock); 7734 7734