From patchwork Tue May 7 10:52:28 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: 163484 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:81:0:0:0:0 with SMTP id l1csp1183718ilm; Tue, 7 May 2019 03:53:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHNDrwh+NLBylL+lQRwMpNa5wGPod4UjvgBkanPErAt5/kq/mLL+YprcJXsc7gEkj7HiY6 X-Received: by 2002:a63:3dcf:: with SMTP id k198mr19310534pga.60.1557226426332; Tue, 07 May 2019 03:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557226426; cv=none; d=google.com; s=arc-20160816; b=ppwK/Ty7nrcolgubbKlPalkPl1BNtoDKU+Ynrm+q+vvwjMGzJFnhe7YMLruuLr2frf J42kAGiZ4MeoqQIaGy+S7+UOhANDdrV++sqkuMT+ISbyGgHVs0dRSJe8l3uEI8f2EAYX hdBNpiLtZypx0K5HA2jneCpOm6YNoARFa1RIhcbnSF7/HtcznFZOR+t58dDOYgx0fse4 y0L4/LTVJsmUc9wR1lUhZj9WSlCuIyiqVijNTa8aPGtUZ2MwjG3j2m6E01iA1+BwGGsK LMSglNIA4aB1vN2fn1im77Ur8ojwBazdKt4DrvOLKT9TwZWIbi6BJIlxQ67oRDPyUr+4 jChw== 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=ZXKYB/TrR+r9BPMb080ZXWXwySiUMrBVGi4P+Gm+R64=; b=HLfknQMzd0jYiY6mW20n/Xbj4cvWfpfsQTpXwt295XJmzgU+pKhgUMQcPB26V1NU0l y/e28WigHT9GpnHLAEPU6009ktvNv9Mw90ThH+Fs60G9l7tbV5xVYziFCu0YTRd3QuQl 71w+Dz5uIkHxNWEpcHWtKqB7mYzLHalTu4g/gPXbXC6TBdC+20Bjw7XcQsYNLNxUZ5C5 t+cq86Sgw6X/Und/yATdXomKEHbpX8138TDmej4iB2SEM6zlFBFOIRu53w0FG/i9wpxO l/0MHjc56ZvwAIDT563Wo0E+9r2Rd8gJ/AJZhlRuR/OPpLejbJrlkwgdW08hpFKWjHOb wTLw== 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 m79si18939528pfi.81.2019.05.07.03.53.46; Tue, 07 May 2019 03:53:46 -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 S1726798AbfEGKxp (ORCPT + 30 others); Tue, 7 May 2019 06:53:45 -0400 Received: from foss.arm.com ([217.140.101.70]:50032 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfEGKxn (ORCPT ); Tue, 7 May 2019 06:53:43 -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 406BFEBD; Tue, 7 May 2019 03:53:42 -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 0D69F3F5AF; Tue, 7 May 2019 03:53:40 -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 01/30] coresight: funnel: Clean up device book keeping Date: Tue, 7 May 2019 11:52:28 +0100 Message-Id: <1557226378-10131-2-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 In preparation to use a consistent device naming scheme, clean up the device link tracking in funnel driver. Use the "coresight" device instead of the "real" parent device for all internal purposes. All other requests (e.g, power management, DMA operations) must use the "real" device which is the parent device. Reviewed-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-funnel.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index 16b0c0e..6236a84 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -32,14 +32,12 @@ /** * struct funnel_drvdata - specifics associated to a funnel 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 funnel. * @csdev: component vitals needed by the framework. * @priority: port selection order. */ struct funnel_drvdata { void __iomem *base; - struct device *dev; struct clk *atclk; struct coresight_device *csdev; unsigned long priority; @@ -80,7 +78,7 @@ static int funnel_enable(struct coresight_device *csdev, int inport, rc = dynamic_funnel_enable_hw(drvdata, inport); if (!rc) - dev_dbg(drvdata->dev, "FUNNEL inport %d enabled\n", inport); + dev_dbg(&csdev->dev, "FUNNEL inport %d enabled\n", inport); return rc; } @@ -110,7 +108,7 @@ static void funnel_disable(struct coresight_device *csdev, int inport, if (drvdata->base) dynamic_funnel_disable_hw(drvdata, inport); - dev_dbg(drvdata->dev, "FUNNEL inport %d disabled\n", inport); + dev_dbg(&csdev->dev, "FUNNEL inport %d disabled\n", inport); } static const struct coresight_ops_link funnel_link_ops = { @@ -165,11 +163,11 @@ static ssize_t funnel_ctrl_show(struct device *dev, u32 val; struct funnel_drvdata *drvdata = dev_get_drvdata(dev->parent); - pm_runtime_get_sync(drvdata->dev); + pm_runtime_get_sync(dev->parent); val = get_funnel_ctrl_hw(drvdata); - pm_runtime_put(drvdata->dev); + pm_runtime_put(dev->parent); return sprintf(buf, "%#x\n", val); } @@ -205,7 +203,6 @@ static int funnel_probe(struct device *dev, struct resource *res) if (!drvdata) return -ENOMEM; - drvdata->dev = dev; drvdata->atclk = devm_clk_get(dev, "atclk"); /* optional */ if (!IS_ERR(drvdata->atclk)) { ret = clk_prepare_enable(drvdata->atclk);