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

drivers/macintosh: 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Kees Cook <keescook@chromium.org>

+4 -6
+4 -6
drivers/macintosh/smu.c
··· 103 103 static int smu_irq_inited; 104 104 static unsigned long smu_cmdbuf_abs; 105 105 106 - static void smu_i2c_retry(unsigned long data); 106 + static void smu_i2c_retry(struct timer_list *t); 107 107 108 108 /* 109 109 * SMU driver low level stuff ··· 582 582 if (!smu) 583 583 return 0; 584 584 585 - init_timer(&smu->i2c_timer); 586 - smu->i2c_timer.function = smu_i2c_retry; 587 - smu->i2c_timer.data = (unsigned long)smu; 585 + timer_setup(&smu->i2c_timer, smu_i2c_retry, 0); 588 586 589 587 if (smu->db_node) { 590 588 smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); ··· 753 755 } 754 756 755 757 756 - static void smu_i2c_retry(unsigned long data) 758 + static void smu_i2c_retry(struct timer_list *unused) 757 759 { 758 760 struct smu_i2c_cmd *cmd = smu->cmd_i2c_cur; 759 761 ··· 793 795 BUG_ON(cmd != smu->cmd_i2c_cur); 794 796 if (!smu_irq_inited) { 795 797 mdelay(5); 796 - smu_i2c_retry(0); 798 + smu_i2c_retry(NULL); 797 799 return; 798 800 } 799 801 mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5));