From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] W83793: ignore the temperature readings
Date: Sat, 13 Jan 2007 19:24:24 +0000 [thread overview]
Message-ID: <20070113202424.06329baa.khali@linux-fr.org> (raw)
In-Reply-To: <45A77F63.5080808@assembler.cz>
Hi Rudolf, Gong,
On Fri, 12 Jan 2007 13:30:27 +0100, Rudolf Marek wrote:
> w83793: ignore the temperature readings when its channel is disabled.
>
> Signed-off-by: Gong Jun <jgong at winbond.com>
> Signed-off-by: Rudolf Marek <r.marek at assembler.cz>
>
> Looks OK to me, Jean. I just fixed the the indentation, strip version to p1, and
> renamed the temp_enable to has_temp, to be coherent with what he have until now.
> Please apply.
Hm, the patch is incomplete. The following changes are missing:
* The temp files are no longer deleted if an error occurs in
w83793_detect().
* The temp files are no longer deleted when the driver in unloaded.
* All the temperature registers are still read in w83793_update_device()
and w83793_update_nonvolatile(). It would be better to skip the
unused temperature registers to speed up the functions.
* The user still has the possibility to change the temperature sensor
type. This is confusing because the driver will not react properly
if the user disables a temperature channel that was previously
enabled. So we should no longer let the user set the temperature
sensor types to 0.
I also have minor comments on the code:
> @@ -1320,6 +1325,30 @@
> data->has_pwm |= 0x80;
> }
>
> + /* check the temp1-6 mode */
> + data->has_temp = 0;
Not needed, kzalloc() zeroed it for you.
> +
> + tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[0]);
> +
> + if (tmp & 0x03)
> + data->has_temp |= 0x01;
> +
> + if (tmp & 0x0c)
> + data->has_temp |= 0x02;
> +
> + if (tmp & 0x30)
> + data->has_temp |= 0x04;
> +
> + if (tmp & 0xc0)
> + data->has_temp |= 0x08;
A few less blank lines would be welcome, as all these instructions are
related.
> +
> + tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[1]);
> +
> + if (tmp & 0x01)
> + data->has_temp |= 0x10;
> + if (tmp & 0x02)
> + data->has_temp |= 0x20;
> +
> /* Register sysfs hooks */
> for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) {
> err = device_create_file(dev,
Please add the missing parts, test again and send the updated patch to
me.
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2007-01-13 19:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-12 12:30 [lm-sensors] [PATCH] W83793: ignore the temperature readings when Rudolf Marek
2007-01-13 19:24 ` Jean Delvare [this message]
2007-01-14 18:02 ` [lm-sensors] [PATCH] W83793: ignore the temperature readings Rudolf Marek
2007-01-16 10:25 ` JGong at winbond.com
2007-01-17 21:03 ` Jean Delvare
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=20070113202424.06329baa.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.