From patchwork Tue Dec 4 15:27:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 1838771 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 18AD53FCA5 for ; Tue, 4 Dec 2012 15:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752591Ab2LDP3c (ORCPT ); Tue, 4 Dec 2012 10:29:32 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:63552 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753638Ab2LDP2e (ORCPT ); Tue, 4 Dec 2012 10:28:34 -0500 Received: by mail-we0-f174.google.com with SMTP id x10so1592855wey.19 for ; Tue, 04 Dec 2012 07:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=+BKXh00UjYq9dZXiamqFNkHsK5t/RQO/eqF5NfO1/Aw=; b=NjaE0VzJTA6WbDAOdAZMhFWAYylnMYqB0MATZhO0KqtELXeVUH/wq1ADr+TNe/Uvqw 6rCBX4ZtzANauXCNHvxebVjGYXIjS614M4/u36KbAaYtAogAWnJdpJdYvixEAkBezjr5 h6SwowJ/pRmNSmNoAftlfa2cDJpY3poztMQhhvnuqvrDtfzJqHi+qCx8pZWpmUzNLYk2 e2d3lDI46hihozGqiFKVYWqqa6fGT7Dj5IqhidVW2ElXpqTP13wozsBDhK1u5ifBHj2d BdnZOBoyz+w3YW8ZqIYYBolvyMYezDelelpkJSFDoYHgg/Hjh/z38Jvoa2IID46je7ES ylIg== Received: by 10.216.85.194 with SMTP id u44mr5095734wee.133.1354634913323; Tue, 04 Dec 2012 07:28:33 -0800 (PST) Received: from localhost.localdomain.com (lan31-8-82-247-176-67.fbx.proxad.net. [82.247.176.67]) by mx.google.com with ESMTPS id p3sm15443846wic.8.2012.12.04.07.28.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Dec 2012 07:28:32 -0800 (PST) From: Benjamin Tissoires To: Benjamin Tissoires , Jiri Kosina , Jean Delvare , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/14] HID: i2c-hid: remove extra .irq field in struct i2c_hid Date: Tue, 4 Dec 2012 16:27:53 +0100 Message-Id: <1354634875-5182-13-git-send-email-benjamin.tissoires@gmail.com> X-Mailer: git-send-email 1.8.0.1 In-Reply-To: <1354634875-5182-1-git-send-email-benjamin.tissoires@gmail.com> References: <1354634875-5182-1-git-send-email-benjamin.tissoires@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org There is no point in keeping the irq in i2c_hid as it's already there in client. Signed-off-by: Benjamin Tissoires --- drivers/hid/i2c-hid/i2c-hid.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 2b49929..bea4b13 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -136,8 +136,6 @@ struct i2c_hid { unsigned long flags; /* device flags */ - int irq; /* the interrupt line irq */ - wait_queue_head_t wait; /* For waiting the interrupt */ }; @@ -737,8 +735,6 @@ static int __devinit i2c_hid_init_irq(struct i2c_client *client) return ret; } - ihid->irq = client->irq; - return 0; } @@ -841,12 +837,12 @@ static int __devinit i2c_hid_probe(struct i2c_client *client, ret = i2c_hid_init_irq(client); if (ret < 0) - goto err; + goto err_irq; hid = hid_allocate_device(); if (IS_ERR(hid)) { ret = PTR_ERR(hid); - goto err; + goto err_irq; } ihid->hid = hid; @@ -876,10 +872,10 @@ static int __devinit i2c_hid_probe(struct i2c_client *client, err_mem_free: hid_destroy_device(hid); -err: - if (ihid->irq) - free_irq(ihid->irq, ihid); +err_irq: + free_irq(client->irq, ihid); +err: i2c_hid_free_buffers(ihid); kfree(ihid); return ret; @@ -904,10 +900,9 @@ static int __devexit i2c_hid_remove(struct i2c_client *client) static int i2c_hid_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); - struct i2c_hid *ihid = i2c_get_clientdata(client); if (device_may_wakeup(&client->dev)) - enable_irq_wake(ihid->irq); + enable_irq_wake(client->irq); /* Save some power */ i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);