Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6905671imb; Sat, 9 Mar 2019 09:32:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyetX7Vhx+4qInDRe3aenFUMR0ncXZkLBe2gAcgNPUnqOFKSFJ9MoLX16j5hutQPrS77sRO X-Received: by 2002:a17:902:8303:: with SMTP id bd3mr25477479plb.10.1552152776208; Sat, 09 Mar 2019 09:32:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552152776; cv=none; d=google.com; s=arc-20160816; b=BwgHRRzGdXDV2Ouo1q/Ci8+QB4VG95HTrXHbi4+NhSDVP4yBDjK/aHmNc4rjg+suva Aqe/zYFJ1DAQztTegwh7CecQw2QrvWornuZJaHQequ0dEHnKjqQRnnqwhYM6pqs6gn6T ffCBpLTeQADe/z62QhboQAhtFI58JDAh3lrcsmLPWHQNfmDZ+jXPmzL6bmkKhE7Wj7X7 4EgHzUU56YnXtFQfXQXdRZjkoiAYAQCd74735Ajy8p8O8XeGvQrEHvDRxJf7Nauq3uvs cV1Ct6kLs+VOgFt61crElwMSH5L1HS+9FY4oZkV5fNqc/ljNX0ZwpqRWFz77kXuDukDt QBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JK2LJAhmnsODTqKbYhlmW1tXN5EVnOJ47rghJmNgmjI=; b=v5IJdRJkgvToU+KN15lrWf250X+6O+xr+6Mpnv/1mVlA2W6+z6dhQI6igwKM2oZoLw 1l2gW2OuW3oWOfeT0MH3A0z7SGuaAHlTTtcpEArhURUHNv8wW4Os9sn99yRVIDvJcLEH tqXBi4WrhOUleWdrHUpG5Xgwoyi3BowwYZr4ZSmrn9BDHF7TWYts5mAA+fkNTFxipEQo dyNjNjVLtIchODWd6+uNKE1MzsprqovJoPPvpM6Qo6E8wgHKNUuI764qIcVtzKniQz76 8PIZsLsD5wy0r0dkIPgaPvXRqIyWwrmiW9bDRYWZWg0Wj3Pu9HWDg7h0z9luzzjtuGJ6 48xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1CSueVFo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23si864781pgv.63.2019.03.09.09.32.39; Sat, 09 Mar 2019 09:32:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1CSueVFo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726400AbfCIRcR (ORCPT + 99 others); Sat, 9 Mar 2019 12:32:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:50286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbfCIRcR (ORCPT ); Sat, 9 Mar 2019 12:32:17 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A60ED20652; Sat, 9 Mar 2019 17:32:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552152736; bh=xpR9CZBTvu1EoR62SAfjWrmd5OFjqVE601E5z9BK+E8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=1CSueVFoKlKYg0cVZaCPmtqp8sKPdWkiU47+NEwTHY/ciNHh4c5xf/nZfxd/RJBGy S+KeIRVz5fcI/JmQCt8f9Openetj6siQFoftXRCs76GvaCLi6bdYrVK7edIfyp0DqV p2XAY2eou8Ajvr2fnsCwgJBZPcRDAZGN+EVKL0xg= Date: Sat, 9 Mar 2019 17:32:11 +0000 From: Jonathan Cameron To: Hans de Goede Cc: "Chen, Hu" , bo.he@intel.com, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Stephan Gerhold , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] io: accel: kxcjk1013: restore the range after resume. Message-ID: <20190309173211.00c205e3@archlinux> In-Reply-To: References: <23ced5ac-b0a0-7d87-76d7-bdec0c3e0e15@redhat.com> <20190306023224.23695-1-hu1.chen@intel.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Mar 2019 09:43:24 +0100 Hans de Goede wrote: > Hi, > > On 06-03-19 03:32, Chen, Hu wrote: > > From: "he, bo" > > > > On some laptops, kxcjk1013 is powered off when system enters S3. We need > > restore the range regiter during resume. Otherwise, the sensor doesn't > > work properly after S3. > > > > Signed-off-by: he, bo > > Signed-off-by: Chen, Hu > > Thanks, patch looks good to me: I'd have had an ever so slight preference for a goto as I prefer errors to be checked for rather than good paths (as that's the more common pattern), but I don't care strongly enough to ask for a v4! > > Reviewed-by: Hans de Goede Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > > Regards, > > Hans > > > > > --- > > v3: Avoid unnecessary mutex_unlock (Hans). > > v2: Handle return value independently (Jonathan). > > > > drivers/iio/accel/kxcjk-1013.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c > > index 7096e577b23f..50f3ff386bea 100644 > > --- a/drivers/iio/accel/kxcjk-1013.c > > +++ b/drivers/iio/accel/kxcjk-1013.c > > @@ -1437,6 +1437,8 @@ static int kxcjk1013_resume(struct device *dev) > > > > mutex_lock(&data->mutex); > > ret = kxcjk1013_set_mode(data, OPERATION); > > + if (ret == 0) > > + ret = kxcjk1013_set_range(data, data->range); > > mutex_unlock(&data->mutex); > > > > return ret; > >