From patchwork Mon Apr 15 16:03:54 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: 162233 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3108370jan; Mon, 15 Apr 2019 09:08:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQr72ep/SXnishZ+ngzuYS2wGF+He6zSNt3VbFZ3bUElxlzEJJ9+YXu6ruggeSjF/9ffNq X-Received: by 2002:a63:360c:: with SMTP id d12mr67397157pga.404.1555344514747; Mon, 15 Apr 2019 09:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555344514; cv=none; d=google.com; s=arc-20160816; b=oozv/EZSKWcXn8GEv7twIXxLbplywDrWxHySk6Vct3cCzIqWePykzLoy/xOB236Xxv wQAM7YlCe2otLKBQ6Venv4FG59iPY1q+SZmS6tu7hbqB8cqgX4yKg8hTebIFbenPDF9o R1H+PCihwvDe+hPXY8HyLDsu1KpyoQg9aEpQWLXHBFqOKYQ8CMghLBzg9YBXAwKKNsrH u9NITzDGhU7VJ6aMNWZMs1ohWAhvdpg9EZiNpejJNAdLzm0pSgAdWiO7IH8RvgNJUPGN eMfrGgsJNgmrhGgYtgvxnpnf5wHRb5bvFEzb7swlly4oBig3GAKIg3wAjQNFwIhnQbKT Dwhg== 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=iit1QsS2QyaN2cYAFGQQ64CnBlwy1tZL9YcLWBjvXok=; b=b74UEgZfLBcv0/EEyqIapTaKR/uMl6ctHLDMV7sxnEnHChWHvi5cWwSEhbMX/z7rKK X+UDuRFEPOZMuUjI3HDKyzvhAiHnMaDKbO6wQUNr5uLxOg1GeKQJCDJ3EGM2xGCJ6Wto 9V/GbSmFTvriWo1D7nxIVCcpf2/lUfk/XO2qYhnIQtVq9jiXIT53is0XO24LzJZaX6w5 BQNUrygU/9QSI9sgx6Wo9VlsBwi/6FCXGGkIs9zBCS8M6KbNtvXCAqVgwb/hpUQvv9UK W6f4iG9HbtQ5gDAjLe87Jd3nSTdPviofhzSOnDivIPOksOGBL3XG1XOvMRkc7UPX09cW Xkww== 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 d2si42993352pgq.129.2019.04.15.09.08.34; Mon, 15 Apr 2019 09:08:34 -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 S1727946AbfDOQGJ (ORCPT + 30 others); Mon, 15 Apr 2019 12:06:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37782 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727924AbfDOQGE (ORCPT ); Mon, 15 Apr 2019 12:06:04 -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 2A5C71688; Mon, 15 Apr 2019 09:06:04 -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 A50383F68F; Mon, 15 Apr 2019 09:06:02 -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 11/36] coresight: stm: Cleanup device specific data Date: Mon, 15 Apr 2019 17:03:54 +0100 Message-Id: <1555344260-12375-12-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 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. Cc: 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 Reviewed-by: Mathieu Poirier 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: