Skip to content

Commit

Permalink
drivers/macintosh: Convert timers to use timer_setup()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kees Cook committed Nov 2, 2017
1 parent 200d24d commit 0788f28
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/macintosh/smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 0788f28

Please sign in to comment.