From patchwork Wed Mar 20 18:49:26 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: 160724 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp627166jan; Wed, 20 Mar 2019 11:52:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/VTC+NKCPi02CqybMSbo+XSgIj983QUhqyfEtH3UUqKF0PzOq7AaDQw60HFvIr73lAklo X-Received: by 2002:aa7:92c1:: with SMTP id k1mr9186956pfa.246.1553107932335; Wed, 20 Mar 2019 11:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553107932; cv=none; d=google.com; s=arc-20160816; b=zI5Gf/pkOIJJxgQWTcQwnxG84a/nRK3LA571IIjmOWjKsiUhXnzLISAm+szLjkWmo5 SsSB/Q0dhAkE86GMuEE467jCqUjRmwsYm4I9rePJ0a+N9mQijz2xWAJmp4U+3ZDe5zep 9f7I26DRLyWXicJX7XwmmpJ37s0sQ54DHU6xhwjBovyjca5AJyHCv1i5v9jp1nEiDPFn m+4V2LVEGZt+YPFYxqYCM410oRcYka2EfOTtX2Jeqz8OxSEltJgePg+7uRPT+Gn/yVVm qEY74rx9yg5zxuVrCv6t2uuzJKdDQbXkv+ptq/yYt3Gv4dNg0r9qawCZo5g6fulyhyVs gg5g== 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=GSWBLLDl+wmICugGAjf3tTlw/U0qJCDn6hLDb+xuTos=; b=J5BYOF+DDLAmmqmBJ3pu36ZbRoFRx5rzS0gy8zTRks/qVcFdSwmQMIlK6gnxidn5ce YGIWkrqdpiHF74mTOQKRloy59267o2Jw3Ozy8C30dRNaBWos/ApworKuVnDuECtscN4c KDTQdsRHNdSOvLstDb2z4tfeF9JY+b1BOEPlJxBTO9XBQtruJ4YYiIeVJvVrsKaToyMo VH0GIwEbWO3W8j9sok952NlQAEtcoBWRRX28KGVLiknOD69YQvGL13CqH5Hi3rotqr3P NAYcqLkKKJSfInHGemqgqx1lVtKRJRR8ChrByhFexDefJUswItPfttD85oSDQx1i9bTQ JAEA== 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 f73si2251341pff.184.2019.03.20.11.52.12; Wed, 20 Mar 2019 11:52:12 -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 S1727569AbfCTSwK (ORCPT + 31 others); Wed, 20 Mar 2019 14:52:10 -0400 Received: from foss.arm.com ([217.140.101.70]:44888 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727558AbfCTSuZ (ORCPT ); Wed, 20 Mar 2019 14:50:25 -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 F17DB174E; Wed, 20 Mar 2019 11:50:24 -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 781C23F59C; Wed, 20 Mar 2019 11:50:23 -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 09/25] coresight: catu: Cleanup device specific data Date: Wed, 20 Mar 2019 18:49:26 +0000 Message-Id: <1553107783-3340-10-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 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 diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 11c6f2f..671a05a 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;