From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932591AbdJXKTA (ORCPT ); Tue, 24 Oct 2017 06:19:00 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:56639 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932289AbdJXKS4 (ORCPT ); Tue, 24 Oct 2017 06:18:56 -0400 X-Google-Smtp-Source: ABhQp+STA5dQEDzQP9bBaUYH0bkcMV0j+hFZqRHXbn6dnyEG8ejoTu5AYWr2LcKe87SftqPU1rc5Rw== Date: Tue, 24 Oct 2017 03:18:53 -0700 From: Kees Cook To: Michael Ellerman Cc: Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH] drivers/macintosh: Convert timers to use timer_setup() Message-ID: <20171024101853.GA69439@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Kees Cook --- drivers/macintosh/smu.c | 10 ++++------ 1 file 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); static int smu_irq_inited; static unsigned long smu_cmdbuf_abs; -static void smu_i2c_retry(unsigned long data); +static void smu_i2c_retry(struct timer_list *t); /* * SMU driver low level stuff @@ -582,9 +582,7 @@ static int smu_late_init(void) if (!smu) return 0; - init_timer(&smu->i2c_timer); - smu->i2c_timer.function = smu_i2c_retry; - smu->i2c_timer.data = (unsigned long)smu; + timer_setup(&smu->i2c_timer, smu_i2c_retry, 0); if (smu->db_node) { 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) } -static void smu_i2c_retry(unsigned long data) +static void smu_i2c_retry(struct timer_list *unused) { struct smu_i2c_cmd *cmd = smu->cmd_i2c_cur; @@ -795,7 +793,7 @@ static void smu_i2c_low_completion(struct smu_cmd *scmd, void *misc) BUG_ON(cmd != smu->cmd_i2c_cur); if (!smu_irq_inited) { mdelay(5); - smu_i2c_retry(0); + smu_i2c_retry(NULL); return; } mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5)); -- 2.7.4 -- Kees Cook Pixel Security