From patchwork Tue May 7 10:52:31 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: 163487 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp1183816ilm; Tue, 7 May 2019 03:53:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz81/MNyOi0Nw8mN3nwCJ/XZAytMqU6HzKcjo42qTa1/Q39qpbaUgGcOMN/PSwaOJvBaLG/ X-Received: by 2002:aa7:8a81:: with SMTP id a1mr7458949pfc.121.1557226433336; Tue, 07 May 2019 03:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557226433; cv=none; d=google.com; s=arc-20160816; b=06PHz++1ylmR7Jon1uXSUpwwIKLR13Pj/iILU3isMC/vwzPdf0MLOXqFRY4+kXqN7p 4vYDqFN3PuGw4lW/7auCJ/ty7oIpmu2MVgPz1tTprKmqQvDH9POuxO9FKiZ9GPeFW/IU I7mNQAYPcBqaRx92PkzClRoIa/udgfNKdxzhqonDA6uStRE+uANjbZ1LZkE1YKsrYEI8 GgnJq+ssCDqJ2hUupDC38fuWC303iFdAETp8Z+ExzSGEK6M1tpmtun0ZJZ9s6saQcb8Z uk6Gms5a/+Pyquw9V9DhnMRHUY2McNUBBbASsld4LMm7RGn+LJzckwmN9xkciRCd3bvS IdXw== 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=0JDu9I25o+fvzTxUTsLCA3Ce7VS4/14p7FKTvbZXZAWcyL2a16GjGteLmAkH+sCIL3 hqBdWxYalZXivWr4Gikzlmmi1Lgxkl1CBdEKVY30UkuKZQ66VbULgKow5RHWMEZ44alR Up4rJfDdVkfTH1jJmZAhIhq1Ld2QLDbHqOAVwMyy7QsBo/Xg1xgQjHwXz/Ln0RggRZNG 7bMnukuhHqjMMAeRaBX8C5Xse9MZP139fNghSR4SVmE4rlXKLGM3346fpEsW7H/f8x4K eoHsjnaJRtH0r8EtvMxdWbbV3DdBI6IzYix50CM7OxkPfBv4DP/hyJAnx1/QZ5r8HmvY TAFg== 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 14si8890951pfu.76.2019.05.07.03.53.52; Tue, 07 May 2019 03:53:53 -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 S1726952AbfEGKxw (ORCPT + 30 others); Tue, 7 May 2019 06:53:52 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50074 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbfEGKxr (ORCPT ); Tue, 7 May 2019 06:53:47 -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 9D7B6EBD; Tue, 7 May 2019 03:53:46 -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 696AB3F5AF; Tue, 7 May 2019 03:53:45 -0700 (PDT) From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, rjw@rjwysocki.net, mathieu.poirier@linaro.org, Suzuki K Poulose Subject: [PATCH v3 04/30] coresight: catu: Cleanup device specific data Date: Tue, 7 May 2019 11:52:31 +0100 Message-Id: <1557226378-10131-5-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557226378-10131-1-git-send-email-suzuki.poulose@arm.com> References: <1557226378-10131-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;