All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, sensors@Stimpy.netroedge.com
Cc: khali@linux-fr.org
Subject: [PATCH] I2C: pcf8574 driver cleanup
Date: Tue, 21 Jun 2005 22:17:47 -0700	[thread overview]
Message-ID: <11194174673876@kroah.com> (raw)
In-Reply-To: <1119417467970@kroah.com>

[PATCH] I2C: pcf8574 driver cleanup

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>

---
commit eb071cbbc38efa4b1d707f540de2ec6283ab0894
tree dd9037caf6acb546abe76f76d60987b8d870a1e4
parent 5d740fe9fefda41292b5cabe70f4f8eff9f8aad0
author Jean Delvare <khali@linux-fr.org> Sat, 04 Jun 2005 13:17:43 +0200
committer Greg Kroah-Hartman <gregkh@suse.de> Tue, 21 Jun 2005 21:52:03 -0700

 drivers/i2c/chips/pcf8574.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/chips/pcf8574.c b/drivers/i2c/chips/pcf8574.c
--- a/drivers/i2c/chips/pcf8574.c
+++ b/drivers/i2c/chips/pcf8574.c
@@ -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);


  reply	other threads:[~2005-06-22  5:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1119417466661@kroah.com>
2005-06-22  5:17 ` [PATCH] I2C: documentation update 3/3 Greg KH
2005-06-22  5:17   ` [PATCH] I2C: lm90 uses new sysfs callbacks Greg KH
2005-06-22  5:17     ` [PATCH] I2C: add adm9240 driver documentation Greg KH
2005-06-22  5:17       ` Greg KH [this message]
2005-06-22  5:17         ` [PATCH] I2C: lm83 uses new sysfs callbacks Greg KH
2005-06-22  5:17           ` [PATCH] I2C: drivers/i2c/chips/it87.c: use dynamic " Greg KH
2005-06-22  5:17             ` [PATCH] I2C: lm63 uses new " Greg KH
2005-06-22  5:17               ` [PATCH] I2C: rename i2c-sysfs.h to hwmon-sysfs.h Greg KH
2005-06-22  5:17                 ` [PATCH] I2C: add new pca9539 driver Greg KH
2005-06-22  5:17                   ` [PATCH] max6875: new i2c device driver Greg KH
2005-06-22  5:17                     ` [PATCH] I2C: fix up ds1374.c driver so it will build Greg KH
2005-06-22  5:17                       ` [PATCH] I2C: Add support for Maxim/Dallas DS1374 Real-Time Clock Chip (2/2) Greg KH
2005-06-22  5:17                         ` [PATCH] I2C: Add support for Maxim/Dallas DS1374 Real-Time Clock Chip (1/2) Greg KH
2005-06-22  5:17                           ` [PATCH] I2C: w83781d: remove non-i2c sensor chips Greg KH
2005-06-22  5:17                             ` [PATCH] I2C: fix ds1374 build Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11194174673876@kroah.com \
    --to=gregkh@suse.de \
    --cc=greg@kroah.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@Stimpy.netroedge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.