From patchwork Tue Jan 13 12:01:06 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: 5619831 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 368879F6E2 for ; Tue, 13 Jan 2015 12:01:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6447020614 for ; Tue, 13 Jan 2015 12:01:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C31682060E for ; Tue, 13 Jan 2015 12:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752338AbbAMMBc (ORCPT ); Tue, 13 Jan 2015 07:01:32 -0500 Received: from smtp-out-231.synserver.de ([212.40.185.231]:1058 "EHLO smtp-out-227.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751191AbbAMMB1 (ORCPT ); Tue, 13 Jan 2015 07:01:27 -0500 Received: (qmail 31091 invoked by uid 0); 13 Jan 2015 12:01:25 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 30945 Received: from p4fde6878.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.222.104.120] by 217.119.54.81 with SMTP; 13 Jan 2015 12:01:24 -0000 From: Lars-Peter Clausen To: Hans Verkuil Cc: linux-media@vger.kernel.org, Lars-Peter Clausen Subject: [PATCH 01/16] [media] adv7180: Do not request the IRQ again during resume Date: Tue, 13 Jan 2015 13:01:06 +0100 Message-Id: <1421150481-30230-2-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1421150481-30230-1-git-send-email-lars@metafoo.de> References: <1421150481-30230-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 --- 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;