diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-21 16:43:53 -0400 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2017-11-02 18:50:49 -0400 |
commit | 0788f28575801dadbddbfbe11e0bcc8174fffee3 (patch) | |
tree | 5cf68e7def8511fc1b255d7d6bb4f5516aedea01 | |
parent | 200d24d63303cc2131c9da571f4ef72887e3aa82 (diff) |
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>
-rw-r--r-- | drivers/macintosh/smu.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index ea9bdc85a21d..899ec1f4c833 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -103,7 +103,7 @@ static DEFINE_MUTEX(smu_part_access); | |||
103 | static int smu_irq_inited; | 103 | static int smu_irq_inited; |
104 | static unsigned long smu_cmdbuf_abs; | 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 | * SMU driver low level stuff | 109 | * SMU driver low level stuff |
@@ -582,9 +582,7 @@ static int smu_late_init(void) | |||
582 | if (!smu) | 582 | if (!smu) |
583 | return 0; | 583 | return 0; |
584 | 584 | ||
585 | init_timer(&smu->i2c_timer); | 585 | timer_setup(&smu->i2c_timer, smu_i2c_retry, 0); |
586 | smu->i2c_timer.function = smu_i2c_retry; | ||
587 | smu->i2c_timer.data = (unsigned long)smu; | ||
588 | 586 | ||
589 | if (smu->db_node) { | 587 | if (smu->db_node) { |
590 | smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); | 588 | smu->db_irq = irq_of_parse_and_map(smu->db_node, 0); |
@@ -755,7 +753,7 @@ static void smu_i2c_complete_command(struct smu_i2c_cmd *cmd, int fail) | |||
755 | } | 753 | } |
756 | 754 | ||
757 | 755 | ||
758 | static void smu_i2c_retry(unsigned long data) | 756 | static void smu_i2c_retry(struct timer_list *unused) |
759 | { | 757 | { |
760 | struct smu_i2c_cmd *cmd = smu->cmd_i2c_cur; | 758 | struct smu_i2c_cmd *cmd = smu->cmd_i2c_cur; |
761 | 759 | ||
@@ -795,7 +793,7 @@ static void smu_i2c_low_completion(struct smu_cmd *scmd, void *misc) | |||
795 | BUG_ON(cmd != smu->cmd_i2c_cur); | 793 | BUG_ON(cmd != smu->cmd_i2c_cur); |
796 | if (!smu_irq_inited) { | 794 | if (!smu_irq_inited) { |
797 | mdelay(5); | 795 | mdelay(5); |
798 | smu_i2c_retry(0); | 796 | smu_i2c_retry(NULL); |
799 | return; | 797 | return; |
800 | } | 798 | } |
801 | mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5)); | 799 | mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5)); |