public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver changes for 2.5.66
Date: Mon, 24 Mar 2003 17:38 -0800	[thread overview]
Message-ID: <10485563193095@kroah.com> (raw)
In-Reply-To: <10485563181090@kroah.com>

ChangeSet 1.889.357.3, 2003/03/21 14:38:21-08:00, greg@kroah.com

[PATCH] i2c: remove *data from i2c_adapter, as dev->data should be used instead.


 drivers/i2c/i2c-elv.c    |    2 +-
 drivers/i2c/scx200_acb.c |    4 ++--
 include/linux/i2c.h      |   17 +++++++++++------
 3 files changed, 14 insertions(+), 9 deletions(-)


diff -Nru a/drivers/i2c/i2c-elv.c b/drivers/i2c/i2c-elv.c
--- a/drivers/i2c/i2c-elv.c	Mon Mar 24 17:28:32 2003
+++ b/drivers/i2c/i2c-elv.c	Mon Mar 24 17:28:32 2003
@@ -150,7 +150,7 @@
 			return -ENODEV;
 		}
 	} else {
-		bit_elv_ops.data=(void*)base;
+		i2c_set_adapdata(&bit_elv_ops, (void *)base);
 		if (bit_elv_init()==0) {
 			if(i2c_bit_add_bus(&bit_elv_ops) < 0)
 				return -ENODEV;
diff -Nru a/drivers/i2c/scx200_acb.c b/drivers/i2c/scx200_acb.c
--- a/drivers/i2c/scx200_acb.c	Mon Mar 24 17:28:32 2003
+++ b/drivers/i2c/scx200_acb.c	Mon Mar 24 17:28:32 2003
@@ -289,7 +289,7 @@
 				char rw, u8 command, int size, 
 				union i2c_smbus_data *data)
 {
-	struct scx200_acb_iface *iface = adapter->data;
+	struct scx200_acb_iface *iface = i2c_get_adapdata(adapter);
 	int len;
 	u8 *buffer;
 	u16 cur_word;
@@ -455,7 +455,7 @@
 
 	memset(iface, 0, sizeof(*iface));
 	adapter = &iface->adapter;
-	adapter->data = iface;
+	i2c_set_adapdata(adapter, iface);
 	snprintf(adapter->dev.name, DEVICE_NAME_SIZE, "SCx200 ACB%d", index);
 	adapter->owner = THIS_MODULE;
 	adapter->id = I2C_ALGO_SMBUS;
diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h	Mon Mar 24 17:28:32 2003
+++ b/include/linux/i2c.h	Mon Mar 24 17:28:32 2003
@@ -219,12 +219,7 @@
 	int (*client_register)(struct i2c_client *);
 	int (*client_unregister)(struct i2c_client *);
 
-	void *data;	/* private data for the adapter			*/
-			/* some data fields that are used by all types	*/
-			/* these data fields are readonly to the public	*/
-			/* and can be set via the i2c_ioctl call	*/
-
-			/* data fields that are valid for all devices	*/
+	/* data fields that are valid for all devices	*/
 	struct semaphore bus;
 	struct semaphore list;  
 	unsigned int flags;/* flags specifying div. data		*/
@@ -241,6 +236,16 @@
 #endif /* def CONFIG_PROC_FS */
 };
 #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
+
+static inline void *i2c_get_adapdata (struct i2c_adapter *dev)
+{
+	return dev_get_drvdata (&dev->dev);
+}
+
+static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
+{
+	return dev_set_drvdata (&dev->dev, data);
+}
 
 /*flags for the driver struct: */
 #define I2C_DF_NOTIFY	0x01		/* notify on bus (de/a)ttaches 	*/


  reply	other threads:[~2003-03-25  1:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-25  1:35 [BK PATCH] i2c driver changes for 2.5.66 Greg KH
2003-03-25  1:38 ` [PATCH] " Greg KH
2003-03-25  1:38   ` Greg KH
2003-03-25  1:38     ` Greg KH
2003-03-25  1:38       ` Greg KH
2003-03-25  1:38         ` Greg KH
2003-03-25  1:38           ` Greg KH [this message]
2003-03-25  1:38             ` Greg KH
2003-03-25  1:38               ` Greg KH
2003-03-25  1:38                 ` Greg KH
2003-03-25  1:38                   ` Greg KH
2003-03-25  1:38                     ` Greg KH
2003-03-25  1:38                       ` Greg KH
2003-03-25  1:38                         ` Greg KH
2003-03-25  1:38                           ` Greg KH
2003-03-25  1:38                             ` Greg KH
2003-03-25  8:55     ` Russell King
2003-03-25  8:58       ` Russell King
2003-03-25  9:17   ` Jan Dittmer
2003-03-26  1:22     ` 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=10485563193095@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /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