linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: Jean Delvare <khali@linux-fr.org>
Cc: Benjamin Tissoires <benjamin.tissoires@gmail.com>,
	linux-input@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] HID: i2c-hid: remove extra .irq field in struct i2c_hid
Date: Thu, 6 Dec 2012 10:56:46 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1212061056410.28002@pobox.suse.cz> (raw)
In-Reply-To: <20121205182812.57262216@endymion.delvare>

On Wed, 5 Dec 2012, Jean Delvare wrote:

> On Wed,  5 Dec 2012 15:02:55 +0100, Benjamin Tissoires wrote:
> > There is no point in keeping the irq in i2c_hid as it's already
> > there in client.
> > 
> > Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>

Applied.

> > ---
> >  drivers/hid/i2c-hid/i2c-hid.c | 15 +++++----------
> >  1 file changed, 5 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> > index d00f185..c6630d4 100644
> > --- a/drivers/hid/i2c-hid/i2c-hid.c
> > +++ b/drivers/hid/i2c-hid/i2c-hid.c
> > @@ -135,8 +135,6 @@ struct i2c_hid {
> >  
> >  	unsigned long		flags;		/* device flags */
> >  
> > -	int			irq;		/* the interrupt line irq */
> > -
> >  	wait_queue_head_t	wait;		/* For waiting the interrupt */
> >  };
> >  
> > @@ -736,8 +734,6 @@ static int __devinit i2c_hid_init_irq(struct i2c_client *client)
> >  		return ret;
> >  	}
> >  
> > -	ihid->irq = client->irq;
> > -
> >  	return 0;
> >  }
> >  
> > @@ -851,7 +847,7 @@ static int __devinit i2c_hid_probe(struct i2c_client *client,
> >  	hid = hid_allocate_device();
> >  	if (IS_ERR(hid)) {
> >  		ret = PTR_ERR(hid);
> > -		goto err;
> > +		goto err_irq;
> >  	}
> >  
> >  	ihid->hid = hid;
> > @@ -881,10 +877,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;
> > @@ -912,10 +908,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);
> 
> Nice clean-up.
> 
> Reviewed-by: Jean Delvare <khali@linux-fr.org>
> 
> -- 
> Jean Delvare
> 

-- 
Jiri Kosina
SUSE Labs

  reply	other threads:[~2012-12-06  9:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 14:02 [PATCH v2 0/4] i2c-hid cleanup and bug fixes Benjamin Tissoires
2012-12-05 14:02 ` [PATCH v2 1/4] HID: i2c-hid: fix memory corruption due to missing hid declaration Benjamin Tissoires
2012-12-05 17:25   ` Jean Delvare
2012-12-06  9:54     ` Jiri Kosina
2012-12-05 14:02 ` [PATCH v2 2/4] HID: i2c-hid: reorder allocation/free of buffers Benjamin Tissoires
2012-12-06  9:56   ` Jiri Kosina
2012-12-05 14:02 ` [PATCH v2 3/4] HID: i2c-hid: remove extra .irq field in struct i2c_hid Benjamin Tissoires
2012-12-05 17:28   ` Jean Delvare
2012-12-06  9:56     ` Jiri Kosina [this message]
2012-12-05 14:02 ` [PATCH v2 4/4] HID: i2c-hid: fix i2c_hid_get_raw_report count mismatches Benjamin Tissoires
2012-12-05 19:59   ` Jean Delvare
2012-12-06 10:01     ` Jiri Kosina
2012-12-07 15:13       ` Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1212061056410.28002@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=benjamin.tissoires@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).