]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
i2c: Constify i2c_get_clientdata's parameter
authorJean Delvare <khali@linux-fr.org>
Wed, 22 Oct 2008 18:21:31 +0000 (20:21 +0200)
committerJean Delvare <khali@linux-fr.org>
Wed, 22 Oct 2008 18:21:31 +0000 (20:21 +0200)
i2c_get_clientdata doesn't change the i2c_client it is passed as a
parameter, so it can be constified. Same for i2c_get_adapdata.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Documentation/i2c/writing-clients
include/linux/device.h
include/linux/i2c.h

index d73ee117a8caecfaf0585aeb4239c27828a7b5df..3b01350c149c1f8df798c45bb0b511fa8eb8e765 100644 (file)
@@ -83,7 +83,7 @@ be very useful.
        void i2c_set_clientdata(struct i2c_client *client, void *data);
 
        /* retrieve the value */
-       void *i2c_get_clientdata(struct i2c_client *client);
+       void *i2c_get_clientdata(const struct i2c_client *client);
 
 An example structure is below.
 
index 987f5912720a2d6ffd6d32a33a062e3b4ef27892..1a3686d15f98f4877dcaad25b393201f6c95640b 100644 (file)
@@ -450,7 +450,7 @@ static inline void set_dev_node(struct device *dev, int node)
 }
 #endif
 
-static inline void *dev_get_drvdata(struct device *dev)
+static inline void *dev_get_drvdata(const struct device *dev)
 {
        return dev->driver_data;
 }
index 4ac8ec3c792737d96513e97a1da624e0c5d6deaf..a411f0b70e8eceb7015faa7afd070b2b232fb37d 100644 (file)
@@ -224,7 +224,7 @@ static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
        return to_i2c_client(dev);
 }
 
-static inline void *i2c_get_clientdata (struct i2c_client *dev)
+static inline void *i2c_get_clientdata(const struct i2c_client *dev)
 {
        return dev_get_drvdata (&dev->dev);
 }
@@ -369,7 +369,7 @@ struct i2c_adapter {
 };
 #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
 
-static inline void *i2c_get_adapdata (struct i2c_adapter *dev)
+static inline void *i2c_get_adapdata(const struct i2c_adapter *dev)
 {
        return dev_get_drvdata (&dev->dev);
 }