From patchwork Fri Jan 23 15:52:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 5695001 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E0E539F2ED for ; Fri, 23 Jan 2015 15:52:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1199A202FE for ; Fri, 23 Jan 2015 15:52:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 181DD20260 for ; Fri, 23 Jan 2015 15:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755664AbbAWPwj (ORCPT ); Fri, 23 Jan 2015 10:52:39 -0500 Received: from smtp-out-190.synserver.de ([212.40.185.190]:1082 "EHLO smtp-out-190.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755402AbbAWPwi (ORCPT ); Fri, 23 Jan 2015 10:52:38 -0500 Received: (qmail 16051 invoked by uid 0); 23 Jan 2015 15:52:36 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 15834 Received: from p4fc46056.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.196.96.86] by 217.119.54.81 with SMTP; 23 Jan 2015 15:52:35 -0000 From: Lars-Peter Clausen To: Hans Verkuil Cc: Sergei Shtylyov , Vladimir Barinov , =?UTF-8?q?Richard=20R=C3=B6jfors?= , Federico Vaga , linux-media@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH v2 01/15] [media] adv7180: Do not request the IRQ again during resume Date: Fri, 23 Jan 2015 16:52:20 +0100 Message-Id: <1422028354-31891-2-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1422028354-31891-1-git-send-email-lars@metafoo.de> References: <1422028354-31891-1-git-send-email-lars@metafoo.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the IRQ is requested from within the init_device() function. This function is not only called during device probe, but also during resume causing the driver to try to request the IRQ again. Move requesting the IRQ from init_device() to the probe function to make sure that it is only requested once. Signed-off-by: Lars-Peter Clausen Acked-by: Hans Verkuil --- drivers/media/i2c/adv7180.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index bffe6eb..172e4a2 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -553,11 +553,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state) /* register for interrupts */ if (state->irq > 0) { - ret = request_threaded_irq(state->irq, NULL, adv7180_irq, - IRQF_ONESHOT, KBUILD_MODNAME, state); - if (ret) - return ret; - ret = i2c_smbus_write_byte_data(client, ADV7180_ADI_CTRL_REG, ADV7180_ADI_CTRL_IRQ_SPACE); if (ret < 0) @@ -597,7 +592,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state) return 0; err: - free_irq(state->irq, state); return ret; } @@ -636,6 +630,13 @@ static int adv7180_probe(struct i2c_client *client, if (ret) goto err_free_ctrl; + if (state->irq) { + ret = request_threaded_irq(client->irq, NULL, adv7180_irq, + IRQF_ONESHOT, KBUILD_MODNAME, state); + if (ret) + goto err_free_ctrl; + } + ret = v4l2_async_register_subdev(sd); if (ret) goto err_free_irq;