linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Kyle Roeschley <kyle.roeschley@ni.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (tmp421) Allow reading at 2Hz instead of 0.5Hz
Date: Thu, 17 Oct 2019 06:41:05 -0700	[thread overview]
Message-ID: <20191017134105.GA6766@roeck-us.net> (raw)
In-Reply-To: <20191014140310.7438-1-kyle.roeschley@ni.com>

On Mon, Oct 14, 2019 at 09:03:10AM -0500, Kyle Roeschley wrote:
> Our driver configures the device to read at 2Hz, but then only allows the
> user to read cached temp values at up to 0.5Hz. Let's allow users to read
> as quickly as we do.
> 
> Signed-off-by: Kyle Roeschley <kyle.roeschley@ni.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/tmp421.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
> index a94e35cff3e5..83a4fab151d2 100644
> --- a/drivers/hwmon/tmp421.c
> +++ b/drivers/hwmon/tmp421.c
> @@ -127,7 +127,8 @@ static struct tmp421_data *tmp421_update_device(struct device *dev)
>  
>  	mutex_lock(&data->update_lock);
>  
> -	if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) {
> +	if (time_after(jiffies, data->last_updated + (HZ / 2)) ||
> +	    !data->valid) {
>  		data->config = i2c_smbus_read_byte_data(client,
>  			TMP421_CONFIG_REG_1);
>  

      reply	other threads:[~2019-10-17 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 14:03 [PATCH] hwmon: (tmp421) Allow reading at 2Hz instead of 0.5Hz Kyle Roeschley
2019-10-17 13:41 ` Guenter Roeck [this message]

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=20191017134105.GA6766@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=kyle.roeschley@ni.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).