[i2c] [PATCH] i2c: Constify i2c_get_clientdata's parameter

Jean Delvare khali at linux-fr.org
Sat Oct 18 14:27:46 CEST 2008


i2c_get_clientdata doesn't change the i2c_client it is passed as a
parameter, so it can be constified.

Signed-off-by: Jean Delvare <khali at linux-fr.org>
---
 include/linux/device.h |    2 +-
 include/linux/i2c.h    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.28-rc0.orig/include/linux/i2c.h	2008-10-18 11:47:53.000000000 +0200
+++ linux-2.6.28-rc0/include/linux/i2c.h	2008-10-18 13:32:30.000000000 +0200
@@ -224,7 +224,7 @@ static inline struct i2c_client *kobj_to
 	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);
 }
--- linux-2.6.28-rc0.orig/include/linux/device.h	2008-10-18 13:54:02.000000000 +0200
+++ linux-2.6.28-rc0/include/linux/device.h	2008-10-18 13:54:11.000000000 +0200
@@ -450,7 +450,7 @@ static inline void set_dev_node(struct d
 }
 #endif
 
-static inline void *dev_get_drvdata(struct device *dev)
+static inline void *dev_get_drvdata(const struct device *dev)
 {
 	return dev->driver_data;
 }


-- 
Jean Delvare



More information about the i2c mailing list