All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Linus <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg KH <greg@kroah.com>, LKML <linux-kernel@vger.kernel.org>,
	linux-next@vger.kernel.org
Subject: Re: [PATCH] i2c: update for semaphore to mutex conversion of devices
Date: Tue, 9 Mar 2010 09:25:08 +0100	[thread overview]
Message-ID: <20100309092508.02b7b2e8@hyperion.delvare> (raw)
In-Reply-To: <20100309102828.18351564.sfr@canb.auug.org.au>

On Tue, 9 Mar 2010 10:28:28 +1100, Stephen Rothwell wrote:
> I have been carrying this patch in linux-next for some time and now
> mainline needs it.
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/i2c/i2c-smbus.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
> index 333527c..52aa775 100644
> --- a/drivers/i2c/i2c-smbus.c
> +++ b/drivers/i2c/i2c-smbus.c
> @@ -27,6 +27,7 @@
>  #include <linux/workqueue.h>
>  #include <linux/i2c.h>
>  #include <linux/i2c-smbus.h>
> +#include <linux/mutex.h>
>  
>  struct i2c_smbus_alert {
>  	unsigned int		alert_edge_triggered:1;
> @@ -55,7 +56,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
>  	 * Drivers should either disable alerts, or provide at least
>  	 * a minimal handler.  Lock so client->driver won't change.
>  	 */
> -	down(&dev->sem);
> +	device_lock(dev);
>  	if (client->driver) {
>  		if (client->driver->alert)
>  			client->driver->alert(client, data->flag);
> @@ -63,7 +64,7 @@ static int smbus_do_alert(struct device *dev, void *addrp)
>  			dev_warn(&client->dev, "no driver alert()!\n");
>  	} else
>  		dev_dbg(&client->dev, "alert with no driver\n");
> -	up(&dev->sem);
> +	device_unlock(dev);
>  
>  	/* Stop iterating after we find the device */
>  	return -EBUSY;

Thanks for the reminder Stephen. I was only waiting for device_lock()
to become usable in mainline. Now that it happened, I will take the
patch above in my i2c tree, and send it to Linus in my next batch.

-- 
Jean Delvare

  parent reply	other threads:[~2010-03-09  8:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 23:28 [PATCH] i2c: update for semaphore to mutex conversion of devices Stephen Rothwell
2010-03-08 23:59 ` Greg KH
2010-03-09  1:50   ` Stephen Rothwell
2010-03-09  2:27     ` Greg KH
2010-03-09 16:04   ` Peter Zijlstra
2010-03-09  8:25 ` Jean Delvare [this message]
2010-03-09 10:36   ` Stephen Rothwell
2010-03-09 10:39     ` Jean Delvare
2010-03-09 10:39       ` Jean Delvare
2010-03-09 10:47       ` Stephen Rothwell
2010-03-09 10:47         ` Stephen Rothwell

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=20100309092508.02b7b2e8@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.