From patchwork Wed May 22 10:34:37 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: 164782 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp693697ili; Wed, 22 May 2019 03:35:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7HCSXhHlvQqJ13xm0/+s/7N18fIb0Wq5VRPlQZNRGmMWAxmB0HAJrO8uDBXWaqQyrbtMr X-Received: by 2002:a17:902:b713:: with SMTP id d19mr28526581pls.123.1558521329847; Wed, 22 May 2019 03:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558521329; cv=none; d=google.com; s=arc-20160816; b=CeGzPTvP+AR75x27RgMCqdY/JuwTvpfRK86hvkkO5bedI0ntNVMCoLn4B6od3YHTFm YuGx9BzvIuA9++20uvp9aCOim5DBuZqfG66r516HzRkZn0jBhllym7N9ChBUoItKmrl6 Q50UeVGvxNkywFBESlYSdE+PD1cTfU7LfmuN4rUkXeQMowtvOfYvYLr+TkyHcVcS0S6O jlKmhKYd25fqo9+37Jl0SXzca3HgMA2gp5ZgSiYCmMXCuPaW3Vx4gVgLAa1OPHitgiYu JLsf2x2cffrZFzACFZIZf0ttwLZnEY8nAWIvJkLbfc0RzqSOJdWffGkWEF3/Br71Xfxe c4MQ== 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=83rGPIcdEyvlUdf0uVjNvmJWDANAlDFhOEgNWAfsv+s=; b=Ch9+mt1VUs1hh7yLNaQt6jLvsY6d2ULAinFaHYmeOsGG8lJjeuIAYvg1b8zzxjCRpD PozUm+eeRQVkHt94gXsE/l8+pi8d5scZos26VuzB659GOKofWrJDVPcFB6w6YE0zfA5Y snJdh2f5oH+Jr1Rbt8ymrQnGO+NQy128ok+Xz7p9h2bMgU8Z6Bf+hdQPbG0DAbhhJl/r 0HKSGsRLZ+Yjrr+HyA5TcHgKeaTj7iyRdbg5VWh+L0Q5yoLPBty9NqKw5etokNTiVa2d Te7irKnUcAoMIOv3wYKNQfjCv7whM3M4xqfcITbMXHc3bPGn/LEnB8jFLFTFVVDMcTiJ E21Q== 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 h68si25312309pgc.270.2019.05.22.03.35.28; Wed, 22 May 2019 03:35:29 -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 S1729246AbfEVKf2 (ORCPT + 30 others); Wed, 22 May 2019 06:35:28 -0400 Received: from foss.arm.com ([217.140.101.70]:46968 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729175AbfEVKfX (ORCPT ); Wed, 22 May 2019 06:35:23 -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 3F2BD15AB; Wed, 22 May 2019 03:35:23 -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 2FB593F575; Wed, 22 May 2019 03:35:22 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, coresight@lists.linaro.org, Suzuki K Poulose Subject: [PATCH v4 04/30] coresight: catu: Cleanup device specific data Date: Wed, 22 May 2019 11:34:37 +0100 Message-Id: <1558521304-27469-5-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558521304-27469-1-git-send-email-suzuki.poulose@arm.com> References: <1558521304-27469-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 Switch to using the CoreSight device instead of the real amba device. Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-catu.c | 13 +++++++------ drivers/hwtracing/coresight/coresight-catu.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index d948a72..63109c9 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -408,13 +408,14 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data) int rc; u32 control, mode; struct etr_buf *etr_buf = data; + struct device *dev = &drvdata->csdev->dev; if (catu_wait_for_ready(drvdata)) - dev_warn(drvdata->dev, "Timeout while waiting for READY\n"); + dev_warn(dev, "Timeout while waiting for READY\n"); control = catu_read_control(drvdata); if (control & BIT(CATU_CONTROL_ENABLE)) { - dev_warn(drvdata->dev, "CATU is already enabled\n"); + dev_warn(dev, "CATU is already enabled\n"); return -EBUSY; } @@ -440,7 +441,7 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data) catu_write_irqen(drvdata, 0); catu_write_mode(drvdata, mode); catu_write_control(drvdata, control); - dev_dbg(drvdata->dev, "Enabled in %s mode\n", + dev_dbg(dev, "Enabled in %s mode\n", (mode == CATU_MODE_PASS_THROUGH) ? "Pass through" : "Translate"); @@ -461,15 +462,16 @@ static int catu_enable(struct coresight_device *csdev, void *data) static int catu_disable_hw(struct catu_drvdata *drvdata) { int rc = 0; + struct device *dev = &drvdata->csdev->dev; catu_write_control(drvdata, 0); coresight_disclaim_device_unlocked(drvdata->base); if (catu_wait_for_ready(drvdata)) { - dev_info(drvdata->dev, "Timeout while waiting for READY\n"); + dev_info(dev, "Timeout while waiting for READY\n"); rc = -EAGAIN; } - dev_dbg(drvdata->dev, "Disabled\n"); + dev_dbg(dev, "Disabled\n"); return rc; } @@ -519,7 +521,6 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id) goto out; } - drvdata->dev = dev; dev_set_drvdata(dev, drvdata); base = devm_ioremap_resource(dev, &adev->res); if (IS_ERR(base)) { diff --git a/drivers/hwtracing/coresight/coresight-catu.h b/drivers/hwtracing/coresight/coresight-catu.h index 1d2ad18..80ceee3 100644 --- a/drivers/hwtracing/coresight/coresight-catu.h +++ b/drivers/hwtracing/coresight/coresight-catu.h @@ -61,7 +61,6 @@ #define CATU_IRQEN_OFF 0x0 struct catu_drvdata { - struct device *dev; void __iomem *base; struct coresight_device *csdev; int irq;