linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
To: "He, Bo" <bo.he@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"ic23@kernel.org" <ic23@kernel.org>,
	"knaack.h@gmx.de" <knaack.h@gmx.de>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>,
	"Chen, Hu1" <hu1.chen@intel.com>
Subject: Re: [PATCH] io: accel: kxcjk1013: restore the range after resume.
Date: Sun, 3 Mar 2019 16:17:28 +0000	[thread overview]
Message-ID: <20190303161728.3571869e@archlinux> (raw)
In-Reply-To: <CD6925E8781EFD4D8E11882D20FC406D52A4C63F@SHSMSX104.ccr.corp.intel.com>

On Thu, 21 Feb 2019 03:13:44 +0000
"He, Bo" <bo.he@intel.com> wrote:

> restore the range register in case kxcjk1013 power is off after suspend
> 
> we see the issue on some laptops, after system suspend and resume,
> the CTRL_REG1 register changed from 0xc8 to 0x80, so acceleration range
> is changed, the patch is to restore the acceleration range after resume.
> 
> Signed-off-by: he, bo <bo.he@intel.com>
> Signed-off-by: Chen, Hu <hu1.chen@intel.com>
Please don't do the ret += trick, it obscures the return value
which we may want to know if anything goes wrong.
Handle each error independently.

Thanks,

Jonathan

> ---
>  drivers/iio/accel/kxcjk-1013.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index 7506bd9..c6bb3be 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -1340,6 +1340,7 @@ static int kxcjk1013_resume(struct device *dev)
>  
>  	mutex_lock(&data->mutex);
>  	ret = kxcjk1013_set_mode(data, OPERATION);
> +	ret += kxcjk1013_set_range(data, data->range);
>  	mutex_unlock(&data->mutex);
>  
>  	return ret;


  reply	other threads:[~2019-03-03 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  3:13 [PATCH] io: accel: kxcjk1013: restore the range after resume He, Bo
2019-03-03 16:17 ` Jonathan Cameron [this message]
2019-03-04  7:05   ` [PATCH v2] " Chen, Hu
2019-03-04  9:16     ` Hans de Goede
2019-03-06  2:32       ` [PATCH v3] " Chen, Hu
2019-03-06  8:43         ` Hans de Goede
2019-03-09 17:32           ` Jonathan Cameron

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=20190303161728.3571869e@archlinux \
    --to=jic23@jic23.retrosnub.co.uk \
    --cc=bo.he@intel.com \
    --cc=hu1.chen@intel.com \
    --cc=ic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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).