All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregkh@suse.de (Greg KH)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] i2c: Rework client usage count, 3 of 3
Date: Fri, 06 Jan 2006 22:07:35 +0000	[thread overview]
Message-ID: <11365852552960@kroah.com> (raw)

[PATCH] i2c: Rework client usage count, 3 of 3

Do not limit the usage count of i2c clients to 1. In other words,
change the client usage count behavior from the old I2C_CLIENT_ALLOW_USE
to the old I2C_CLIENT_ALLOW_MULTIPLE_USE. The rationale is that no
driver actually needs the limiting behavior, and the unlimiting
behavior is slightly easier to implement.

Update the documentation to reflect this change.

Signed-off-by: Jean Delvare <khali at linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>

---
commit cf02df770228350254251fde520007a2709db785
tree ef10929d0160ebf27f29bac2a9e285b267a63331
parent cde7859bda0d1124392b44e50aa11df99707e1d9
author Jean Delvare <khali at linux-fr.org> Sat, 26 Nov 2005 21:03:41 +0100
committer Greg Kroah-Hartman <gregkh at suse.de> Thu, 05 Jan 2006 22:16:22 -0800

 Documentation/i2c/porting-clients |    1 +
 drivers/i2c/i2c-core.c            |    5 -----
 include/linux/i2c.h               |    4 +---
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients
index 64c610b..6b07f23 100644
--- a/Documentation/i2c/porting-clients
+++ b/Documentation/i2c/porting-clients
@@ -92,6 +92,7 @@ Technical changes:
   Drop client->id.
   Drop any 24RF08 corruption prevention you find, as this is now done
   at the i2c-core level, and doing it twice voids it.
+  Don't add I2C_CLIENT_ALLOW_USE to client->flags, it's the default now.
 
 * [Init] Limits must not be set by the driver (can be done later in
   user-space). Chip should not be reset default (although a module
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index d16b499..a1c5dff 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -497,14 +497,9 @@ int i2c_use_client(struct i2c_client *cl
 	if (ret)
 		return ret;
 
-	if (client->usage_count > 0)
-		goto busy;
 	client->usage_count++;
 
 	return 0;
- busy:
-	i2c_dec_use_client(client);
-	return -EBUSY;
 }
 
 int i2c_release_client(struct i2c_client *client)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 8b4d469..85c517a 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -307,9 +307,7 @@ extern struct i2c_client *i2c_get_client
    extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *);
    to make sure that client-struct is valid and that it is okay to access
    the i2c-client. 
-   returns -EACCES if client doesn't allow use (default)
-   returns -EBUSY if client doesn't allow multiple use (default) and 
-   usage_count >0 */
+   returns -ENODEV if client has gone in the meantime */
 extern int i2c_use_client(struct i2c_client *);
 extern int i2c_release_client(struct i2c_client *);
 



             reply	other threads:[~2006-01-06 22:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-06 22:07 Greg KH [this message]
2006-01-06 22:07 ` [lm-sensors] [PATCH] i2c: Rework client usage count, 2 of 3 Greg KH
2006-01-06 22:07 ` [lm-sensors] [PATCH] i2c: Rework client usage count, 1 " Greg KH

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=11365852552960@kroah.com \
    --to=gregkh@suse.de \
    --cc=lm-sensors@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 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.