From patchwork Mon Apr 15 16:03:52 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: 162235 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3108574jan; Mon, 15 Apr 2019 09:08:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpkoKvSYtaHGJUKsolDHXOKV8VZYNJwcAstu2p/+knCs5MvHWEC6q2B64t06rKzPyxCMP1 X-Received: by 2002:a63:54b:: with SMTP id 72mr68262707pgf.323.1555344524699; Mon, 15 Apr 2019 09:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555344524; cv=none; d=google.com; s=arc-20160816; b=mDPNU0ARh8Y7VIMyYbs5tnrbrMFo0SuWGof1kGAYmM/EUOdbQSaTRlWZj4gWjgjSkt TsiDeJypyd8AuizgdF2VfOIkTNF8x5pPPfJH20NYKEbinM3EY8NF8PkUQhOFWd6ZkEMl 5Ti0vxnKPasH4Ir/hKVIl8L0RhPlNn0WyqJyR2Y+0P7MvJunQM5lWux2K5qzehKt7hNM 9VgPHQyybLeN8hl1l/rwEgfHAyPfLPCoIka4p8ISR6h2QJ4kLm9X1r0fY2q/2wlErmEl CuBZKewHtNzo33JaHFF8ZK4b0NX6Mplmb/kqRXvUf3gIDv7LliKok3iAsI/PyEBAdOK5 pVlA== 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=z/PymDYVDiM9wVro/S63hhRt8/VwXeUWOIpIvobKO/s=; b=RZ9U0GqCM3SMz0VO6NCbnKbT2VYZvx6E6uswGl+iJUDXAkNdVcmM3Odnr9nkgq0+LL +63Obx7ZNJkERuQXc+Hk1JOUtpTAfgTk5UlFBc8s3Zt8wcLegKRb5ETBFCxbYZxEiAmk Km5CIatzjfmnA4XMPKeWD+1l2SmMa4PGov/bXDobF9d6BSgvE9DqPYhSsSRHSLKtVzlA tt7NMIg70sGH5DzuSPeExFGzziswrCulh3dEwc8DSlDSov82greWBNKkgzYruir1Jy4X GKwmofa1M/q3cKJxo90B3jV8MULJIQHrUbBjwAs/buZxqc8q9pytO2LbsEh9udYE9WFp qmCQ== 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 e15si34002643pfj.60.2019.04.15.09.08.44; Mon, 15 Apr 2019 09:08:44 -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 S1727919AbfDOQGD (ORCPT + 30 others); Mon, 15 Apr 2019 12:06:03 -0400 Received: from foss.arm.com ([217.140.101.70]:37756 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbfDOQGA (ORCPT ); Mon, 15 Apr 2019 12:06:00 -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 A178480D; Mon, 15 Apr 2019 09:06:00 -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 264493F68F; Mon, 15 Apr 2019 09:05:59 -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 09/36] coresight: catu: Cleanup device specific data Date: Mon, 15 Apr 2019 17:03:52 +0100 Message-Id: <1555344260-12375-10-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 Switch to using the CoreSight device instead of the real amba device. Cc: 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 Reviewed-by: Mathieu Poirier diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index ba3c005..14d1cf5 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 1b281f0..96ea8c4 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;