]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] I2C: pcf8574 driver cleanup
authorJean Delvare <khali@linux-fr.org>
Sat, 4 Jun 2005 11:17:43 +0000 (13:17 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Jun 2005 04:52:03 +0000 (21:52 -0700)
I found a possible cleanup in the pcf8574 driver. We don't need to store
the read value in our private data structure, as we then never use it
again. I asked Aurelien and he is fine with the change. Please apply,
thanks.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/i2c/chips/pcf8574.c

index 4956e9effd75ca93551da5cc388e7548f93b53f3..cfcf646540804c11780bb4d6503f74f075a4635c 100644 (file)
@@ -57,7 +57,7 @@ SENSORS_INSMOD_2(pcf8574, pcf8574a);
 struct pcf8574_data {
        struct i2c_client client;
 
-       u8 read, write;                 /* Register values */
+       u8 write;                       /* Remember last written value */
 };
 
 static int pcf8574_attach_adapter(struct i2c_adapter *adapter);
@@ -79,9 +79,7 @@ static struct i2c_driver pcf8574_driver = {
 static ssize_t show_read(struct device *dev, struct device_attribute *attr, char *buf)
 {
        struct i2c_client *client = to_i2c_client(dev);
-       struct pcf8574_data *data = i2c_get_clientdata(client);
-       data->read = i2c_smbus_read_byte(client); 
-       return sprintf(buf, "%u\n", data->read);
+       return sprintf(buf, "%u\n", i2c_smbus_read_byte(client));
 }
 
 static DEVICE_ATTR(read, S_IRUGO, show_read, NULL);