[patch] add i2c_clientname()

Gerd Knorr (kraxel@bytesex.org)
Wed, 2 Apr 2003 18:51:16 +0200


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!
-
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/