Re: [PATCH] i2c driver changes for 2.5.67

From: Greg KH (greg@kroah.com)
Date: Wed Apr 09 2003 - 17:31:39 EST


ChangeSet 1.1133.1.2, 2003/04/08 02:48:29-07:00, kraxel@bytesex.org

[PATCH] i2c: add i2c_clientname()

This patch just adds a #define and a inline function to hide the
"i2c_client->name" => "i2c_client->dev.name" move introduced by
the recent i2c updates. That makes it easier to build i2c drivers
on both 2.4 and 2.5 kernels.

 include/linux/i2c.h | 7 +++++++
 1 files changed, 7 insertions(+)

diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h Wed Apr 9 15:16:15 2003
+++ b/include/linux/i2c.h Wed Apr 9 15:16:15 2003
@@ -182,6 +182,13 @@
         return dev_set_drvdata (&dev->dev, data);
 }
 
+#define I2C_DEVNAME(str) .dev = { .name = str }
+
+static inline char *i2c_clientname(struct i2c_client *c)
+{
+ return c->dev.name;
+}
+
 /*
  * The following structs are for those who like to implement new bus drivers:
  * i2c_algorithm is the interface to a class of hardware solutions which can

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 15 2003 - 22:00:19 EST