From patchwork Mon May 31 13:12:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 450510 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp887313jao; Mon, 31 May 2021 07:38:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxg49+6VyJY3DNnXVppaQ2BrP/+Nvo+h5NI2MQeepN7Fzg/BLh/Faovh/yAxgQXIBlI7eTw X-Received: by 2002:a02:9109:: with SMTP id a9mr21220852jag.93.1622471935985; Mon, 31 May 2021 07:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471935; cv=none; d=google.com; s=arc-20160816; b=EIffwjvD5ZqN1vSCIsIfGpTqTOcdUGAM611rNs57rrueEgRprKY2t3AaBePbkwGXXE GwgiI6yRO3INI99OXEq0+rqCSpgI1zXpY9crpyLR8dk/Tx5UxVu5scBC8se1UFS6UDz1 8HOzNzqi+foLXndij+1uXbsdjwV7FZbrAWo96al5YjVeTMdCmUTPX9iknWDrSqANxUbB Tf6GiTXousM6DriUW+AbEF02lMF+gfGmXzk1Fzgs34eN3FFk9b+FYyyCqL8073kM90yb 9cLYyCA2nxCK0hrBhtnSay/1hHGmZIBb2DkxfYG4mRTfWZhX+oRPADZTbKPh1ETE2tvy JQVQ== 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=GhBtmj5eF1TFvMf35+3bKiYOKNfLfxIKgy3U1R9cimPCnnGcZAAgi0ot9nxNpuXq0e FWqudde7JRunanEKq+rGVGaEcOx/jeaqKba9RLn2RgxVBre0XZ2wpZejGHSdWLaZzPGB GJ7GjlcUT8P3ODRmWqpTNfluy513Jjo8twDipM+O4jrBEloxxj/k07Pb90eR20Miys1u c1ie9Lmary0bs55oIFt1Ae0DAyue4EL50QXAOsUgQqsacuyVQZU4ShTn+yluxQ+9vZR0 ZiLXq6RcD8qJ0T7XFe4wnyTmpeeqDup/+xbTIYKYK+N+qCDapw4PjRQCzl+olQqHedQA D3Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SGJes3KF; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 x5si16471919ilu.87.2021.05.31.07.38.55; Mon, 31 May 2021 07:38:55 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=SGJes3KF; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S232624AbhEaOkb (ORCPT + 12 others); Mon, 31 May 2021 10:40:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:33234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbhEaOhi (ORCPT ); Mon, 31 May 2021 10:37:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C53761C53; Mon, 31 May 2021 13:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469118; bh=DSf4XqPjzvaq/zKi0DCw4Gh+8Dfiy3EAaMlzty3/gvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGJes3KFifNnDCfJtaksxrhDcwybXmKrHesDBq0Fk7RB28IJjo6SgR8weDgIVZk2+ /JEd11G5dFxHGkF6WVsqTXeZH2uR1uZtzZALFb7JyrlbEEAVMz4Ch5KL0ZKxUDlcaN 2tEj1SY3abUGWi/OXBtulDls/7lFd2wCW5cqsexc= 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.12 076/296] iio: gyro: fxas21002c: balance runtime power in error path Date: Mon, 31 May 2021 15:12:11 +0200 Message-Id: <20210531130706.410618809@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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; }