Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751921AbdHaXjX (ORCPT ); Thu, 31 Aug 2017 19:39:23 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:35420 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdHaXjT (ORCPT ); Thu, 31 Aug 2017 19:39:19 -0400 X-Google-Smtp-Source: ADKCNb6OxfefdNDvPTsV2KriYDh599b6NDLsynhd8wBCZFX1dM8W4v6XlFmju2UsrTJ9vIEQ2GSW5g== From: Kees Cook To: Thomas Gleixner Cc: Kees Cook , Mats Randgaard , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/31] media/i2c/tc358743: Initialize timer Date: Thu, 31 Aug 2017 16:29:29 -0700 Message-Id: <1504222183-61202-18-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504222183-61202-1-git-send-email-keescook@chromium.org> References: <1504222183-61202-1-git-send-email-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1090 Lines: 29 This converts to use setup_timer() to set callback and data, though it doesn't look like this would have worked with timer checking enabled since no init_timer() was ever called before. Cc: Mats Randgaard Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Kees Cook --- drivers/media/i2c/tc358743.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 5788af238b86..94e722e0f4e0 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1964,8 +1964,8 @@ static int tc358743_probe(struct i2c_client *client, } else { INIT_WORK(&state->work_i2c_poll, tc358743_work_i2c_poll); - state->timer.data = (unsigned long)state; - state->timer.function = tc358743_irq_poll_timer; + setup_timer(&state->timer, tc358743_irq_poll_timer, + (unsigned long)state); state->timer.expires = jiffies + msecs_to_jiffies(POLL_INTERVAL_MS); add_timer(&state->timer); -- 2.7.4