Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3382705imm; Tue, 29 May 2018 06:23:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZraxUXD6WcqscCdKvdhB//H29kgRE6u1AP1UIjY7XH39siyDTbWbWn/Tf/exIjE5nGxxzCw X-Received: by 2002:a17:902:bf0a:: with SMTP id bi10-v6mr17255211plb.235.1527600222278; Tue, 29 May 2018 06:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527600222; cv=none; d=google.com; s=arc-20160816; b=MzZx0YJDy/nIwRGAkJBoH9JpGvXgu+kyK9gUvoJlUQwrd4z8/LBqBjsnIkb10B6Ogh ZDV6PCEGpysS23QlrKaU9ccEeTrX9hq7ygLhrSdmmZ+yFdL6DjRNVus+koBcBorDlqSF NB1RGj+TaElrZBPiuIt910Lal3VXxqAtNQDmbnYEXfkjilviOHt2zcuPWyL5axKBByQ6 rQdtxm8wo1C/iUtNwqMCC32z0VSAEkLVcVuPKcjEnlkneNrfqhY7GuGQc+GHe0fU6qsg MELHmcppOwUTXUFOD88vlBoEHs8tToHoeMTFsQ9HdJ3DIIaJjZ5wVZruwCb6z0RCmv/s V7og== 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=v2bdOo8KOyUxCnA3gZqjCDAFsU/Zmx3lTg22TO/7hvo=; b=bBcjGae8gZ5bEJl4bJs1JI8Jps0IuqagIVaKjHblNq6GDRe/0iicjIseSh56Vn15cz vK6HVDEo6L3rWUSZMIWkpWUWNN3zzcC0RavVoVr1NAbVeCB5op3jmqk8d2JpaIE/hHqb Xjf3CSLuACHw78+VY7/FaxZLrKLtj9OlgDLEY8ROA69muMF55c7//hdR52jn0TReaGBf wjA3g7drEFVaxOWubYi+FsYYkEDWhi4V8364Ly4EnuevSozcDTU1En+P4Re0m73KWZ2d WMZ29yCIJ64cJBmh5fOl3JeVUPsu2zSg23hoCz3tLT7cbYCCuzLnk1VdPUGSuEe0FURv 8DXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XWY/Dz+J; 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 p17-v6si25645309pgv.67.2018.05.29.06.23.27; Tue, 29 May 2018 06:23:42 -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=XWY/Dz+J; 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 S934248AbeE2NXE (ORCPT + 99 others); Tue, 29 May 2018 09:23:04 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:59139 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933444AbeE2NXC (ORCPT ); Tue, 29 May 2018 09:23:02 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4TDMrAt019171; Tue, 29 May 2018 08:22:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1527600173; bh=v2bdOo8KOyUxCnA3gZqjCDAFsU/Zmx3lTg22TO/7hvo=; h=From:To:CC:Subject:Date; b=XWY/Dz+JdkTiAHw4jkwPXSe0brkxCzy/Hxg0bVKlvUfnjjkedKU0FNKmePgtVlpFN F7kyMLv4BEzSIb91uAtsc2Advjadolx0iY2PsCrTQ3VfYlsixMBW5jNvNEhpRDkfLV kPCd/xbMj/n71T8v28iOQB6MlFohi6qI9BRrLFZc= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4TDMr6Z028236; Tue, 29 May 2018 08:22:53 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) 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, 29 May 2018 08:22:52 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 29 May 2018 08:22:52 -0500 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4TDMo5V027043; Tue, 29 May 2018 08:22:50 -0500 From: Faiz Abbas To: , , , CC: , , Subject: [PATCH] can: m_can: Fix runtime resume call Date: Tue, 29 May 2018 18:54:26 +0530 Message-ID: <20180529132426.31216-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 --- 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 a9fbf81ac3d4..04c48371ab2a 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