Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2652912pxj; Mon, 31 May 2021 07:27:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv3Y4aqEkTXYZm2DVfAJDVLpfDK5b8TLg4/ydZ5P4NiAgSw08z6TpmEshLFIX1ZxcV32Ik X-Received: by 2002:a92:d5c4:: with SMTP id d4mr5055024ilq.71.1622471252148; Mon, 31 May 2021 07:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471252; cv=none; d=google.com; s=arc-20160816; b=jyXrtsaYYaqAQJ7ITMm78uWCcm+8Q+W8ISKCssBZ+NhIanp8+hjZZ1z8YTynApUESs xtsZ6CD22QYQfnorhKkW/D6Bmk5J3pipvnMrIgXoOLMUdv/PpLPXMAVjkcgHFZVDVVyT QcZnpq2F8zS3OGro+OtBf2A3zXOiWFYXn2uriMFHve0yJhZkTh0pASijE7hfCOCcEQKB QXMRGmvCo1qhk2XkBAR3P0cECAmmbmMElQQxURhsCzk/wZTGegl6wGRxlhASxJE14lCH Jda94kmuQONbnWCfVoNTwzsx+Gi2Oc0D/9o48cOvsKzjSo8s+N+Czk1KhLg+v3xWDvef bVAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0DUi4w49LGQq7ZddOjIgqe2iR9bZC9cDkh6aHXPJoQM=; b=VOWflfn2wUQm3TAZehWz4hhc1LlLWmETxm6ynRMdZy1kXbzFHIb10BNIRkt3Gc4CLx G+EK+TFWVIlcAV8iEt5NBwZe4QNntb0SAUsz34USUX1VeE25ho5OL4WX9LrR8caE8JqG 8pbKUX8ImO/To+be/V8/y/RfJ9/KVmHR3I7tEOhnMbcTbAEtsBfCdlcvE+eck5ykhrwF X72yiZMHfSMxTuGTi9/eGCUewNT7zstI9yT3IGBzUq6r2VG2ohZJczDia9YGXTF5OW97 1k52LEkVlFfQPVWOeH1c+kI7cZDL5yV4sOwNYEbCbDxubYl6wpMdGdbVJXibPRb7wwFD Pwhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iDpzHtGg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si16130158jac.95.2021.05.31.07.27.19; Mon, 31 May 2021 07:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iDpzHtGg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232563AbhEaO2L (ORCPT + 99 others); Mon, 31 May 2021 10:28:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:55328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232460AbhEaNvl (ORCPT ); Mon, 31 May 2021 09:51:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5DB5F616EB; Mon, 31 May 2021 13:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467951; bh=DSf4XqPjzvaq/zKi0DCw4Gh+8Dfiy3EAaMlzty3/gvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iDpzHtGgKSbG4Rxqzm7a3gO0cWXYbeA877YypDrj/O/+HLyGkKxLnPvOliSTaKVpi QrEHQdszT+OWO05+teKqaS1Z/AvzEJ57+fTo1B7tUYhY40f+R8Hlmv7cegexslzL7N gsqV7RVU4djkXTP0Ztn1lt0/XU9MVahCY3HOsPB8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauro Carvalho Chehab , Rui Miguel Silva , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.10 061/252] iio: gyro: fxas21002c: balance runtime power in error path Date: Mon, 31 May 2021 15:12:06 +0200 Message-Id: <20210531130700.050104168@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rui Miguel Silva commit 2a54c8c9ebc2006bf72554afc84ffc67768979a0 upstream. If we fail to read temperature or axis we need to decrement the runtime pm reference count to trigger autosuspend. Add the call to pm_put to do that in case of error. Fixes: a0701b6263ae ("iio: gyro: add core driver for fxas21002c") Suggested-by: Mauro Carvalho Chehab Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/linux-iio/CBBZA9T1OY9C.2611WSV49DV2G@arch-thunder/ Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/gyro/fxas21002c_core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/iio/gyro/fxas21002c_core.c +++ b/drivers/iio/gyro/fxas21002c_core.c @@ -399,6 +399,7 @@ static int fxas21002c_temp_get(struct fx ret = regmap_field_read(data->regmap_fields[F_TEMP], &temp); if (ret < 0) { dev_err(dev, "failed to read temp: %d\n", ret); + fxas21002c_pm_put(data); goto data_unlock; } @@ -432,6 +433,7 @@ static int fxas21002c_axis_get(struct fx &axis_be, sizeof(axis_be)); if (ret < 0) { dev_err(dev, "failed to read axis: %d: %d\n", index, ret); + fxas21002c_pm_put(data); goto data_unlock; }