From patchwork Mon Apr 15 16:03:49 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: 162237 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3108726jan; Mon, 15 Apr 2019 09:08:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHR+1aTqOuD6EXsVXhWsgOMzuiRHpWGNW0oUIshGlRxpUUSsafGaxt9q86TsaXTBoqGdDk X-Received: by 2002:a62:14d7:: with SMTP id 206mr74777416pfu.162.1555344531024; Mon, 15 Apr 2019 09:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555344531; cv=none; d=google.com; s=arc-20160816; b=0Kxa0/WZInGJYFc6+cBCBvnKcStGYlWAe+gA5FaKwa5J363sGB4Yon4SwVnncu3B0W 2Tn6OpAxwJLFmTy1qWsmOWlZybvrbu//+PolRoTne3G1jl3Cd7JxxwCsAFx7RethymG6 aeyVzspd8zJwZrBx3RVFr8NL6PORIrZcNY6q6Ve3tlNMy65/DzIrukRWsrYyA2LN/Cx0 tJdURePzOwZx3KI3pO8K0HfG0D1cW78D8bW9lbgA83eYSVmN+zqXS1BxUVfMuzIg5nE4 u99anIYEOnsX58e89z5EoENjyPXoQyFaSJNavhtVwigBfuYZekMMU/S8tGNhOuKKpp20 rzmg== 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=I8B20Z3zpp4XTuuJBfXEFP6+PR/B6XhfMv5xfSKUsKU=; b=dk/ToSIlhtCka/NX2iAMe3TKBff8hw1bng+SVicwx913ZXP9iWD+b8AJanKXMf+tqw s9eW9dDXvvEkFTKLX+Xw0gQeifNxTUAAmFvILf4KNWOsocDBl72agqAqCfxGbUYtHwoZ fQLzp1g2+irwoGVNhVML3mKE+7oR3QHs0U/JtLGwh2SrRJUqf2SQGryv1HO+1GDAwjlN EizPsO7DCa90T4SKECMsagkhPrLB2ph5yKZxVxe+3CsR8fxEgMYfpYjUcUhPvov9fP7/ PByNYr9FxTEbDHyVhRPK2X/amJZs7d7nCrqnVOKvNo02HamDSQxZJmUrnmvESdOP3kj/ cVUA== 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 v10si47036438pgj.576.2019.04.15.09.08.50; Mon, 15 Apr 2019 09:08:51 -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 S1727889AbfDOQF7 (ORCPT + 30 others); Mon, 15 Apr 2019 12:05:59 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37718 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727853AbfDOQFz (ORCPT ); Mon, 15 Apr 2019 12:05:55 -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 3E4D31684; Mon, 15 Apr 2019 09:05:55 -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 B8E4C3F68F; Mon, 15 Apr 2019 09:05:53 -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 06/36] coresight: funnel: Clean up device book keeping Date: Mon, 15 Apr 2019 17:03:49 +0100 Message-Id: <1555344260-12375-7-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 In preparation to use a consistent device naming scheme, clean up the device link tracking in funnel driver. Use the "coresight" device instead of the "real" parent device for all internal purposes. All other requests (e.g, power management, DMA operations) must use the "real" device which is the parent device. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-funnel.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.7.4 Reviewed-by: Mathieu Poirier diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 9279251..1085f31 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -37,7 +37,6 @@ */ struct funnel_drvdata { void __iomem *base; - struct device *dev; struct clk *atclk; struct coresight_device *csdev; unsigned long priority; @@ -77,7 +76,7 @@ static int funnel_enable(struct coresight_device *csdev, int inport, rc = funnel_enable_hw(drvdata, inport); if (!rc) - dev_dbg(drvdata->dev, "FUNNEL inport %d enabled\n", inport); + dev_dbg(&csdev->dev, "FUNNEL inport %d enabled\n", inport); return rc; } @@ -105,7 +104,7 @@ static void funnel_disable(struct coresight_device *csdev, int inport, funnel_disable_hw(drvdata, inport); - dev_dbg(drvdata->dev, "FUNNEL inport %d disabled\n", inport); + dev_dbg(&csdev->dev, "FUNNEL inport %d disabled\n", inport); } static const struct coresight_ops_link funnel_link_ops = { @@ -160,11 +159,11 @@ static ssize_t funnel_ctrl_show(struct device *dev, u32 val; struct funnel_drvdata *drvdata = dev_get_drvdata(dev->parent); - pm_runtime_get_sync(drvdata->dev); + pm_runtime_get_sync(dev->parent); val = get_funnel_ctrl_hw(drvdata); - pm_runtime_put(drvdata->dev); + pm_runtime_put(dev->parent); return sprintf(buf, "%#x\n", val); } @@ -199,7 +198,6 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) if (!drvdata) return -ENOMEM; - drvdata->dev = &adev->dev; drvdata->atclk = devm_clk_get(&adev->dev, "atclk"); /* optional */ if (!IS_ERR(drvdata->atclk)) { ret = clk_prepare_enable(drvdata->atclk);