From patchwork Tue Sep 15 14:12:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 309654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BBCBC43461 for ; Tue, 15 Sep 2020 23:39:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1FD1120715 for ; Tue, 15 Sep 2020 23:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600213143; bh=S2lpl7cJCH8k86S3isb6+lxcBkcnXCLPfDJsLAkhxKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=a6bwgFFsKY+H9SnpullHuyY3vQ7ITAqAB0Ccq4hwl9j9TVNXU/UvzjqfvCe7+wwe7 72jScLfum7N5FFPDHCUj2Yrrg+hYVUByECTf0x4oBjzj2HcGRX6qVeefofwCo7S0in gJ7DyUQqveOQ4xK6lQ/dhOFiV5qMwCfDYJyKAOeQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727149AbgIOXhA (ORCPT ); Tue, 15 Sep 2020 19:37:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbgIOOfY (ORCPT ); Tue, 15 Sep 2020 10:35:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 8E3C42224A; Tue, 15 Sep 2020 14:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179959; bh=S2lpl7cJCH8k86S3isb6+lxcBkcnXCLPfDJsLAkhxKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v8/kOP5JLpNRb0u9pNW9zMVXQaUjpvozVwzZFv4PZkQSt+aqPGNiRQJ6xPlXvEwN4 C5xklnwfzzeEUhpjTlG0sIsJMZMIo2BgqaGVw1C4ARpzeIUgPe+O74PSKK17H+7L2c kMHxmoDrk3jUhRGXyFXYH4b4vpiekNUUU8iQsXHQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Alain Volmat , Mark Brown , Sasha Levin Subject: [PATCH 5.8 051/177] spi: stm32: fix pm_runtime_get_sync() error checking Date: Tue, 15 Sep 2020 16:12:02 +0200 Message-Id: <20200915140656.076740999@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140653.610388773@linuxfoundation.org> References: <20200915140653.610388773@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter [ Upstream commit c170a5a3b6944ad8e76547c4a1d9fe81c8f23ac8 ] The pm_runtime_get_sync() can return either 0 or 1 on success but this code treats 1 as a failure. Fixes: db96bf976a4f ("spi: stm32: fixes suspend/resume management") Signed-off-by: Dan Carpenter Reviewed-by: Alain Volmat Link: https://lore.kernel.org/r/20200909094304.GA420136@mwanda Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index a00f6b51ccbfc..3056428b09f31 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -2064,7 +2064,7 @@ static int stm32_spi_resume(struct device *dev) } ret = pm_runtime_get_sync(dev); - if (ret) { + if (ret < 0) { dev_err(dev, "Unable to power device:%d\n", ret); return ret; }