From patchwork Mon Apr 15 16:03:48 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: 162206 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3104924jan; Mon, 15 Apr 2019 09:05:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9/RwBFWm/3fIbs3UkN2+y0VCfbQX2nT75eC1goOTE0OFl36d5HfIvb8sobkkrn7YYfjFH X-Received: by 2002:a65:4589:: with SMTP id o9mr54153503pgq.381.1555344356586; Mon, 15 Apr 2019 09:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555344356; cv=none; d=google.com; s=arc-20160816; b=SoOEpZIkMZv+XbOwn+dixVc4RsfsyHpFPfwlye9EYC2YCiPde7y00uholADLllQHY3 sZ3dhzLm5exkYoQXgKxEhn25KhF0sUAvA+DpAW6KI1DxEcAeY5TTGDCMmS9V5BRthx9x aWv9Qm2p5jNCiV+kQgLmItktnGIkyEY3M8Yq2hQ30tTfptJpAZZdxviie1VkyAI54+Sq pTgMiIcV/kpnuAdkNNq4Mv+m3b2U+710mD1AsIH80oRc27SC8vDoLvzMaVBfAZ3PRvKg bmQoDjtsBoMa8qAJMqG/Oloe43NbFaOUKWWO0/NJN+RqQY8SBapNmXZNt0Q8M+lFKxcC CbaA== 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=5YRgV+d5Xo3QfgfN3QUlhr4n2vQSXrQXKW4VFQNiM6U=; b=a2E9UwqeAqsIxSLWPKU/GRAGc3fdad1m1DSUjnnduy2LEBNqRewxiC6SV2UC6by8hJ MxJS7IhfT0awL5sL7LDg6NuKr8lovUN9jAr8dn4Eotz4g4gfaH2I3vOicD+tUZ5i1byE zd0zYQCeU2rY9/25iy98GNWQdVkRb93301WJE1wi0KV9lTw+6Mn0/OjixaX7kky/4HuC SQIZZXWp9QPCSeIhYicvfv6Y0rls3R0Qrp3HQn0RJNOh4rps8fnHGsLpQs5aFyeC4CUk c+/m4QKeP3GamK8DfyFlCI908Qm1msDQLiKfZz5M4UCvCiu081BNvgSKHEJsgayZhI6x DXpw== 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 w8si23771255pgr.529.2019.04.15.09.05.56; Mon, 15 Apr 2019 09:05:56 -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 S1727870AbfDOQFz (ORCPT + 30 others); Mon, 15 Apr 2019 12:05:55 -0400 Received: from foss.arm.com ([217.140.101.70]:37704 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727853AbfDOQFx (ORCPT ); Mon, 15 Apr 2019 12:05:53 -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 7B692A78; Mon, 15 Apr 2019 09:05:53 -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 ECA6A3F68F; Mon, 15 Apr 2019 09:05:51 -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 05/36] coresight: tmc: Cleanup power management Date: Mon, 15 Apr 2019 17:03:48 +0100 Message-Id: <1555344260-12375-6-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 if we were successful in probing the device. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-tmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 647b6aa..c6a5462 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -432,8 +432,6 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) drvdata->size = readl_relaxed(drvdata->base + TMC_RSZ) * 4; } - pm_runtime_put(&adev->dev); - desc.pdata = pdata; desc.dev = dev; desc.groups = coresight_tmc_groups; @@ -476,6 +474,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) ret = misc_register(&drvdata->miscdev); if (ret) coresight_unregister(drvdata->csdev); + else + pm_runtime_put(&adev->dev); out: return ret; }