From patchwork Thu Apr 25 19:52:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 162883 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2364105jan; Thu, 25 Apr 2019 12:55:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMy+DGK6V+TqQCW26UG9wT7xNnz49A11xuyYX1IH+1bo8DsWNE7YbotkM5F4JdzeYZ2vcB X-Received: by 2002:a17:902:8c89:: with SMTP id t9mr42387547plo.265.1556222133753; Thu, 25 Apr 2019 12:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556222133; cv=none; d=google.com; s=arc-20160816; b=ALVnC/2K+EH+ZteG8oJHfcZ/rXLcqWuvHsEls0cd9rGRnR0EpppUxspO/fY/jsI1eG d+DUfRTjeoadpnr5aKMYwUCbf6XVaY4yc3jhQRGdsLWgNFIxWvwDdNpDOkyb2DfZzrC8 SDq22gYOxuyvmlFACKQJWw0n8wLgYrRiFnr0dhxDEaNvvieWjtvDao3RUKcqfTSVxen5 tijj6qN2L6R+iQvadlX3TN9dGDNHDZQfxrV2j8cZSE4p5A1xAGqP/o7tmJrIegsi6Zuo rmhXFO/LsrMiRvR22c+G03mjdTegmPvJ7sssNxLpHj/AOSBM9BltoIKE7ls/VSmA5dQ0 egvQ== 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:dkim-signature; bh=gDKvnZtlQcJ/F2zJQhfvE482g7t3vSsFp5ROjl2xttU=; b=a+3rXX76pCVdpTaRyynqG8eUORpqLR4WaQgvGXeXjPC2ZFAdM9xPx669e0QE/WsHwY jo1EWyvTk5FhxsvNhhPyfRS+lyk0ef6QsQcQFmHzpcwQ9Ag3tJUhAp4vfVwhNe/srzHT hrWJqK7l5/tt2kanUYETZQ7VE+7+VCtbZpo8Ges9M0Co4hSwzCNQbKNAcot13azjC72/ gVh69vrMUbXorDhD+jSWMKdEbc7xuMig86RkNYHhNBnf354z+gCqt/YBUcObcwYzcQwE qUAZCfxvte6x7/EiEnAsUqbbEPvJjEJzZTAuAiJ/P6jIfIj9xzip2xL3fY74KK26kcw1 sdeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ldl8eDGE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p61si24142011plb.428.2019.04.25.12.55.33; Thu, 25 Apr 2019 12:55:33 -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=@linaro.org header.s=google header.b=ldl8eDGE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387968AbfDYTzc (ORCPT + 30 others); Thu, 25 Apr 2019 15:55:32 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45826 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387681AbfDYTx0 (ORCPT ); Thu, 25 Apr 2019 15:53:26 -0400 Received: by mail-pf1-f195.google.com with SMTP id e24so420154pfi.12 for ; Thu, 25 Apr 2019 12:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gDKvnZtlQcJ/F2zJQhfvE482g7t3vSsFp5ROjl2xttU=; b=ldl8eDGERjZIk7NuTVJ9jRJEehmNTz/FLrTt7FDfDdcvu0VbNp2uZ2U/kagpl4Plr+ cF9vn3eNR0PTyXL+gF1gGO6IEp6LmgLx0D5TvTwTRreXzTgPWHvclElWrZ63tmKWoPVA 1AJ6WICl1ajyhmMGE3RsL+lCaSKUAFfuE7HLAdbKhWdoWiT7HVnE77NbQJ4rPLn8mREY VHyort6GiUukCu+DRuMQwV3FqKlSwQvWGiYJDnq9ARbdik7Kdy4B3x5cdyu+sqmtelWC UfqVBUPSQt/FlmemvuRCwp4UEUp+jO6sNsBiOVVCtdzEdnYYQYTWM5kCd2XnjPuw2Qhc gyEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gDKvnZtlQcJ/F2zJQhfvE482g7t3vSsFp5ROjl2xttU=; b=V27JaB69s4OdWEiyV8IZcZAK6b6l4SEjqlRvYnus/j+kj0ygBuDXylITPgW49BGF5Z 7GHGrLqkCKKuRX1BnpocRr1ZaGyqlPWzsb9fmwFhGHH13hw49bM/DXn11Dz7thmiLl/K /QDQqnBxcDkMlfQrGvLEIgSlGpA0swxQXTyWYPQoaWlRC+E1DdigIDSj2RaiFw8cHAnc cF1lEP8JzLK0d1otmZxuU9domxKAkLzmQdGKTYpciVMTlRvffbuCU2h5aeTeS4OWvtJf ixeQN5n9EQka/2DyJp/JDQXcVE6PjVaMv8GtcplIrlxU6VYywUaGllFDjfl+sY31zn82 5/Fw== X-Gm-Message-State: APjAAAVyLGk3PjsZpfiiqLsV+AIqd1hIIulPwk222q1Ur0OxGvRPCSl9 rqk7IS4e9crefxRISftwxuMAmw== X-Received: by 2002:a63:fb58:: with SMTP id w24mr3428924pgj.444.1556222005459; Thu, 25 Apr 2019 12:53:25 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id t64sm47261961pfa.86.2019.04.25.12.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 12:53:24 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/32] coresight: tpiu: Cleanup power management Date: Thu, 25 Apr 2019 13:52:48 -0600 Message-Id: <20190425195310.31562-11-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190425195310.31562-1-mathieu.poirier@linaro.org> References: <20190425195310.31562-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suzuki K Poulose 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 [Removed extra newline left after original modification] Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-tpiu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c index b2f72a1fa402..93e2ef34e734 100644 --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -153,8 +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; desc.ops = &tpiu_cs_ops; @@ -162,7 +160,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