public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] add i2c_clientname()
@ 2003-04-02 16:51 Gerd Knorr
  2003-04-03  1:01 ` Greg KH
  2003-04-08 23:04 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Gerd Knorr @ 2003-04-02 16:51 UTC (permalink / raw)
  To: Kernel List, Greg KH, Frank Davis

  Hi,

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.

  Gerd

diff -u linux-2.5.66/include/linux/i2c.h linux/include/linux/i2c.h
--- linux-2.5.66/include/linux/i2c.h	2003-04-02 11:42:19.455041606 +0200
+++ linux/include/linux/i2c.h	2003-04-02 11:49:36.479533709 +0200
@@ -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

-- 
Michael Moore for president!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-08 22:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-02 16:51 [patch] add i2c_clientname() Gerd Knorr
2003-04-03  1:01 ` Greg KH
2003-04-03  8:57   ` Gerd Knorr
2003-04-08 23:04 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox