From patchwork Wed Mar 20 18:49:23 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: 160705 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp625700jan; Wed, 20 Mar 2019 11:50:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgxcKl+/+SjGdJ0oKQ+BzH1ZOm+iPzHQuNxVOkQTm/253WnVClBmxm6UfM4+Nm7COp1LMf X-Received: by 2002:a65:60c7:: with SMTP id r7mr9056451pgv.37.1553107826521; Wed, 20 Mar 2019 11:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553107826; cv=none; d=google.com; s=arc-20160816; b=uYXmJfH+bB1qBCkc2ZK7yc5fkwC90EMgzxfaaSoO7waH7n/H7mIlZ8aOrRT5yjohFc H1AnMlqQ1r+vtvb4eTZux3laROaTNxbCFGVeusIMf6jasvaFYf1XwJohesoUZsWha1T7 zN9VTT4DGG9qQX1bkQ1WH7YPZ4uETJdu9zRzx7NZipMfD45DmvjbSrT608cj4EJqnlin 6KJXogMKK+ajlVrM7DeEMw33XxapBu1sUMlTx5wgPf0IM5kxGWCmIh5XW5B5V9udfkMc 7LaQyiyEN0NvFczTMkWJrQ8s42tRmJyCyadIkZ3MEJZaXRjXRpPeHrtj/eDXfm2P/VO/ 7ORQ== 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=7KWAhN8DodSuchFa9XkBf7mwaIWhD1sNfVsiwoGh55c=; b=SB7BoJRdGvrekvg3nLhzRcrwfOYODbvCXB9b8m4jmF0BRtUnwUkbx6TIg90/64wBKd Q3NjaDdpgbw7yFgp0FaVVMLPNo8WZjUNbgJsXx8AWmhsbS/8n3V5F7L/G80Ey75YcJ2z XWPt8MeWNVxJkLtLMR4vfjUeEcu3nMJyafPUTJmReVMp6MQ7eHoRGcCIV5VUGnDXtcfG LcQ9ZlztQnZcTtU1Ay7bP8muC1hyslmbDbl41rVoEaqRu5pvaGswSl7ygmyUwCOAJr3v mjcqgeaBauyYuT6x+ulG8iPuMefcGUX7fQy6Mqb3O6hbKEMRMtPSbiFRaIJDHatJA6pc P68g== 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 d1si2232925pgv.580.2019.03.20.11.50.26; Wed, 20 Mar 2019 11:50:26 -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 S1727555AbfCTSuX (ORCPT + 31 others); Wed, 20 Mar 2019 14:50:23 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44854 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727251AbfCTSuU (ORCPT ); Wed, 20 Mar 2019 14:50:20 -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 B71A91A25; Wed, 20 Mar 2019 11:50:19 -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 3D93A3F59C; Wed, 20 Mar 2019 11:50:18 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, coresight@lists.linaro.org, mike.leach@linaro.org, robert.walker@arm.com, Suzuki K Poulose , Mathieu Poirier Subject: [PATCH 06/25] coresight: funnel: Clean up device book keeping Date: Wed, 20 Mar 2019 18:49:23 +0000 Message-Id: <1553107783-3340-7-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1553107783-3340-1-git-send-email-suzuki.poulose@arm.com> References: <1553107783-3340-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 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);