From patchwork Mon Apr 15 16:03:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 162204 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3104849jan; Mon, 15 Apr 2019 09:05:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1kIO7LX1iIF3FYHMWE7eIPoahNXoQTaIRdd6hohs/f3lgAiD81k1N0Y/44PrAIX34xc9i X-Received: by 2002:a63:3dca:: with SMTP id k193mr69044891pga.146.1555344353457; Mon, 15 Apr 2019 09:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555344353; cv=none; d=google.com; s=arc-20160816; b=B3F8gAlpTm9j6We5XgxyggwHJYZ/2gw03QA6pyXUq+7A0G5B6dewubzpsJe0K1Jjqo ga8hIe3aJzfz97Gbv36WnE4KaImzYxeyvXR48unHwM9/03G6mABl4dgJZ2NjmXVlyb4s qNw5B5E7ZsmBEQltpEn8X+xzsZ/AvK6Eo1+vSGKCRjZnJpz4TFORhQCxMCKzlFFB6xfb hbpGZa1ifrUdyc5p9+4i+3ddaROt8LNVWHayfzXX1cdYUXHWaN6Aq0qfBgCw9Z6vcQ+u gTJ3mJyntcIDnXagC4ejgF1+9aoR5qm7CGvOBpwlzTm+3NoF7hbKZ2efllDLBcjNnm07 SZHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=P7zZRig3LerlzOi0MDjoYOm2AcJJpDsYasfqmv/xPXQ=; b=D0IIe1wSy8q10vvVxLrG84xgW6ze2VBdGT8CqjXAun0RjbxomM3A93aL0/zb9zG8ab rPhMRSRXV8idZ6g2cq+XJX0De/fmQvpybGeVwWxJBYdoh3Dznha/LjoYNdohTwMBULIP 4Vs9uqryB/VMFE0t2Oh+qx3E09g4XbGGXkJk7M9bXC8A4TVttwa/JXO/GvDMJnu5cjnu uI8CAf5cAmU1aBqdVB314kgpd7WU1p4Ey/mvR1nm8929jNVck43g3J6yRT4CXJBB8/DX oLBhVX9g2SBQPfDVJHe7NHvXZQTd3ih3i//OaYtNs5TQS565z5pWsJqCLUKn7LZ68aLs hygQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si16547264plb.158.2019.04.15.09.05.53; Mon, 15 Apr 2019 09:05:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727840AbfDOQFw (ORCPT + 30 others); Mon, 15 Apr 2019 12:05:52 -0400 Received: from foss.arm.com ([217.140.101.70]:37670 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727143AbfDOQFu (ORCPT ); Mon, 15 Apr 2019 12:05:50 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E2DDDA78; Mon, 15 Apr 2019 09:05:49 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 602993F68F; Mon, 15 Apr 2019 09:05:48 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, mathieu.poirier@linaro.org, mike.leach@linaro.org, rjw@rjwysocki.net, robert.walker@arm.com, Suzuki K Poulose Subject: [PATCH v2 03/36] coresight: tpiu: Cleanup power management Date: Mon, 15 Apr 2019 17:03:46 +0100 Message-Id: <1555344260-12375-4-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555344260-12375-1-git-send-email-suzuki.poulose@arm.com> References: <1555344260-12375-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop the power only when we have successfully probed. Otherwise leave it to the amba probe to do the rest. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-tpiu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c index b2f72a1..4977467 100644 --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -153,7 +153,6 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) /* Disable tpiu to support older devices */ tpiu_disable_hw(drvdata); - pm_runtime_put(&adev->dev); desc.type = CORESIGHT_DEV_TYPE_SINK; desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_PORT; @@ -162,7 +161,12 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) desc.dev = dev; drvdata->csdev = coresight_register(&desc); - return PTR_ERR_OR_ZERO(drvdata->csdev); + if (!IS_ERR(drvdata->csdev)) { + pm_runtime_put(&adev->dev); + return 0; + } + + return PTR_ERR(drvdata->csdev); } #ifdef CONFIG_PM