Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1015833imm; Tue, 3 Jul 2018 04:10:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdEcapF63oeH/4a841+JuxrIvKU8OdNSdwTU8HgKzgME1Ymc+yUNVV1TIkqtAv7brScQruH X-Received: by 2002:a62:c218:: with SMTP id l24-v6mr513489pfg.185.1530616216374; Tue, 03 Jul 2018 04:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530616216; cv=none; d=google.com; s=arc-20160816; b=IKgsOHbIifMrtitSVH9X2VB+Lc7MzU29SkaiVumasIbr71jUZq2gwwrD1SVXAUrLkQ Svzw6nCWgEwZwY/qNXPOZJHujkLA0aZbqVrqAYxra6hhUgon/rokdTnr5JLuRUYw5mHa VdI9tx7QEyTmoI7sOnt+qF2HYX9o6L6ZZd2+08WJznV/z3UWUnKVnqqzyaSJp3kdR0B5 nl/bG2iBLbQNGbh3FPLlJeSP9EJNE9sZYw7bqCH5tMiN3zTOg3ewLw2Lqz7QZ4PtYVEh Bwmnvp4ekpwKVXFIJac8s9WqBoJDkaEdQEQlkdBE48F3fFSBqcA0SNntMRQYBVyV5lMh K1eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=p6v5syPvQOGDgdPzR0P24uEG2T1NFNawHrLy63EbFyw=; b=qkWIUcOsaSyaWZqyTZb694P79xckGtDaV0tk1DdpubNaBvDDSRHfxrZnvzheilmNJs bXQ7va4z2L9C1VOLGlMAzvf1BGJwPRe8K5aC6JSXRdhPN/TDQtaLYAIXX/+gbcwd9v/n jQ4mekqjIORHVLx3ueZD6bd9e1ZeO9VOOJgGFYAKcxzMuwjffzzPA+6yK1R8YyJSHcSe wFUuoWHRC1ws+3cBPyRAvLlXsbJ9XWA3Oi21El1d9iDTTKHAlXsttzDmXx72T144Ca5T u0hhUBJ7rN0oq+6lVEFBrKOdMJSniqLV6KeWIDHVAc9gkyTxKTS5Ekiz36VUY1uZjk6E AQ+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RBqtAPe9; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e85-v6si940202pfl.132.2018.07.03.04.10.01; Tue, 03 Jul 2018 04:10:16 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=RBqtAPe9; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbeGCLJX (ORCPT + 99 others); Tue, 3 Jul 2018 07:09:23 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:52228 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbeGCLJW (ORCPT ); Tue, 3 Jul 2018 07:09:22 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w63B9B3g091203; Tue, 3 Jul 2018 06:09:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1530616151; bh=p6v5syPvQOGDgdPzR0P24uEG2T1NFNawHrLy63EbFyw=; h=From:To:CC:Subject:Date; b=RBqtAPe9vUaPP24bX9p4AxGKguLK5W9vKXxrQgqWZ+FBwzYbXVvFo4OZIDfJvrT2J ePXlK8buV0bvQTxhmHMz7DXgiFJ2uxA+DkDzOFTwdWJyiDDUkB4Lki+L9qjx+QseDO fxhzt5J1n4wbCEP8XRT5T7jWvq8hf7gdBrCEMup8= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w63B9BTV015088; Tue, 3 Jul 2018 06:09:11 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 3 Jul 2018 06:09:11 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 3 Jul 2018 06:09:11 -0500 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w63B98I6031175; Tue, 3 Jul 2018 06:09:09 -0500 From: Faiz Abbas To: , , , CC: , , , Subject: [PATCH v2] can: m_can: Fix runtime resume call Date: Tue, 3 Jul 2018 16:41:02 +0530 Message-ID: <20180703111102.26502-1-faiz_abbas@ti.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync() returns a 1 if the state of the device is already 'active'. This is not a failure case and should return a success. Therefore fix error handling for pm_runtime_get_sync() call such that it returns success when the value is 1. Also cleanup the TODO for using runtime PM for sleep mode as that is implemented. Signed-off-by: Faiz Abbas --- Changes in v2: rebased to latest mainline drivers/net/can/m_can/m_can.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index b397a33f3d32..ac4c6dc2f8c8 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -634,10 +634,12 @@ static int m_can_clk_start(struct m_can_priv *priv) int err; err = pm_runtime_get_sync(priv->device); - if (err) + if (err < 0) { pm_runtime_put_noidle(priv->device); + return err; + } - return err; + return 0; } static void m_can_clk_stop(struct m_can_priv *priv) @@ -1687,8 +1689,6 @@ static int m_can_plat_probe(struct platform_device *pdev) return ret; } -/* TODO: runtime PM with power down or sleep mode */ - static __maybe_unused int m_can_suspend(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); -- 2.17.0