From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] I2C: simplify max6875 driver
Date: Wed, 27 Jul 2005 18:52:10 +0000 [thread overview]
Message-ID: <20050727185140.7191ac52.khali@linux-fr.org> (raw)
In-Reply-To: <200507121321.11458.bgardner@wabtec.com>
Hi Ben,
> [PATCH] I2C: simplify max6875 driver
>
> This is an update to the max6875 driver.
> It no longer does any detection, so the address must be forced on
> module load. It only makes available the user EEPROM (read-only).
Sorry for the delay. I see that Greg picked your patch, so it's about
time that I take a look and comment on it.
> +static void max6875_update_slice(struct i2c_client *client, int slice)
> {
> struct max6875_data *data = i2c_get_clientdata(client);
> - int i, j, addr, count;
> - u8 rdbuf[SLICE_SIZE];
> + int i, j, addr;
> + u8 *buf;
> int retval = 0;
retval is set in various place in this function, but not returned?
> +static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
I don't much like seeing a function with such a generic name in a
specific driver. This could easily collide with something similar
declared in a public header (i2c.h comes to mind). Shouldn't this inline
function be moved to i2c.h right now?
> if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA
> | I2C_FUNC_SMBUS_READ_BYTE))
You don't seem to be calling i2c_smbus_read_byte_data() anywhere, so you
could check for only I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
I2C_FUNC_SMBUS_READ_BYTE. Not that it should change anything practically
though.
> + strlcpy(fake_client->name, "max6875-dummy", I2C_NAME_SIZE);
The typical name for "fake clients" is "<client name> subclient".
On the documentation front:
> modprobe max6875 force=0,0x50
This made me realize that forcing eeprom drivers (eeprom and max6875) is
nor properly handled WRT 24RF08 corruption prevention. I will submit a
separate patch fixing this for both drivers.
> Reads and write are performed differently depending on the address range.
I'd guess write_s_?
As Greg accepted your last updates already, any fix you would submit now
would be as an incremental patch.
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2005-07-27 18:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-12 20:21 [lm-sensors] [PATCH] I2C: simplify max6875 driver bgardner
2005-07-27 18:52 ` Jean Delvare [this message]
2005-07-27 19:10 ` BGardner
2005-09-05 23:47 ` 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=20050727185140.7191ac52.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.org \
/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.