From patchwork Tue May 7 10:52:33 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: 163514 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp1185954ilm; Tue, 7 May 2019 03:56:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6NGL1y9qlFkg1HUrJTVjuZSmLlWig2tdV24mXWWr6UqpJWsS9EX4X3VSf1unM/+Wu592Y X-Received: by 2002:a62:ed10:: with SMTP id u16mr40012864pfh.187.1557226585882; Tue, 07 May 2019 03:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557226585; cv=none; d=google.com; s=arc-20160816; b=TUmQq01PREvZgLp62Xdid8zS9Ftacs0MYDDNrzZ4b4VRapzbTbGm0qjKRSJCd+fhQb njKWE5cUB4IV8Y62MIux3YzonYt9Qg5MSdbUCW7ENtJlE2OLlanAzceTy9dIMNKIDaaa cQoawP9eW8YWiTaWBPHLvp+SQM1SaxcmIC9EnqwUkmN5pI6H8uboSdpT7aknTQFJx4Rk EGD24FvWjv8jsraN3+OThBBds4ZIybNBzP6SOD0gFVok2TBZEeftuQjC3gHodJh+ksau sPPQkOdFhir505JztZd1Qhzbn3uOdBqnpI2YnFU5dnX8gTf+T628vA02/jjv33AGi+wN uqKw== 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=GhI/fWzdKFO1h3y22DjsO2bVbWSpJmauhyOHrfGkOoc=; b=q2qJNr2Z6zuTiJ2k0C1jEbCUbGg+o7nMYWzF5xvMs0lFGHx2mENfpSVJg6B5HN2UyX Z02ui1TGqCTY851dm1lHIrE1xV6an55YCtTd+Xr65a7g8/5185C8rjRMiIebdzaWf/90 bFSht0HG3O3k9dE889rmFZghkc5EOPQCJYej7/pOs1Jd9HswZA5mEFLWoMmOnqPIuwVz OD3XXocGaLVUhS28P1DR+YlOn30flugVNOxWJPuTiegMwyNalXNpjuNqanKNCQtTnSy/ AuKDjSQI5xjYgCnxYBDVaTX36Tc4+gTUFzx/l3geh57qhW3QleobqYziHGi4cH+YXfHc cX3g== 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 e19si17628684pgv.63.2019.05.07.03.56.25; Tue, 07 May 2019 03:56:25 -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 S1727308AbfEGK4Y (ORCPT + 30 others); Tue, 7 May 2019 06:56:24 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50106 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbfEGKxt (ORCPT ); Tue, 7 May 2019 06:53:49 -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 8836D374; Tue, 7 May 2019 03:53:49 -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 550573F5AF; Tue, 7 May 2019 03:53:48 -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 06/30] coresight: stm: Cleanup device specific data Date: Tue, 7 May 2019 11:52:33 +0100 Message-Id: <1557226378-10131-7-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 Keep track of the STM coresight device which is a child device of the AMBA device. Since we can get to the coresight_device from the "device" instance, remove the explicit field. Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-stm.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 9f8a844..8f50484 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -110,7 +110,6 @@ struct channel_space { /** * struct stm_drvdata - specifics associated to an STM component * @base: memory mapped base address for this component. - * @dev: the device entity associated to this component. * @atclk: optional clock for the core parts of the STM. * @csdev: component vitals needed by the framework. * @spinlock: only one at a time pls. @@ -128,7 +127,6 @@ struct channel_space { */ struct stm_drvdata { void __iomem *base; - struct device *dev; struct clk *atclk; struct coresight_device *csdev; spinlock_t spinlock; @@ -205,13 +203,13 @@ static int stm_enable(struct coresight_device *csdev, if (val) return -EBUSY; - pm_runtime_get_sync(drvdata->dev); + pm_runtime_get_sync(csdev->dev.parent); spin_lock(&drvdata->spinlock); stm_enable_hw(drvdata); spin_unlock(&drvdata->spinlock); - dev_dbg(drvdata->dev, "STM tracing enabled\n"); + dev_dbg(&csdev->dev, "STM tracing enabled\n"); return 0; } @@ -271,10 +269,10 @@ static void stm_disable(struct coresight_device *csdev, /* Wait until the engine has completely stopped */ coresight_timeout(drvdata->base, STMTCSR, STMTCSR_BUSY_BIT, 0); - pm_runtime_put(drvdata->dev); + pm_runtime_put(csdev->dev.parent); local_set(&drvdata->mode, CS_MODE_DISABLED); - dev_dbg(drvdata->dev, "STM tracing disabled\n"); + dev_dbg(&csdev->dev, "STM tracing disabled\n"); } } @@ -763,9 +761,10 @@ static void stm_init_default_data(struct stm_drvdata *drvdata) bitmap_clear(drvdata->chs.guaranteed, 0, drvdata->numsp); } -static void stm_init_generic_data(struct stm_drvdata *drvdata) +static void stm_init_generic_data(struct stm_drvdata *drvdata, + const char *name) { - drvdata->stm.name = dev_name(drvdata->dev); + drvdata->stm.name = name; /* * MasterIDs are assigned at HW design phase. As such the core is @@ -807,7 +806,6 @@ static int stm_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); @@ -848,7 +846,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) spin_lock_init(&drvdata->spinlock); stm_init_default_data(drvdata); - stm_init_generic_data(drvdata); + stm_init_generic_data(drvdata, dev_name(dev)); if (stm_register_device(dev, &drvdata->stm, THIS_MODULE)) { dev_info(dev, @@ -870,7 +868,8 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) pm_runtime_put(&adev->dev); - dev_info(dev, "%s initialized\n", (char *)coresight_get_uci_data(id)); + dev_info(&drvdata->csdev->dev, "%s initialized\n", + (char *)coresight_get_uci_data(id)); return 0; stm_unregister: