From patchwork Mon Apr 15 16:04:17 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: 162217 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3106146jan; Mon, 15 Apr 2019 09:06:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPjucLNx+47pa5Wqhe9LzKYujG3msqYOXglo0odREYNFENWpgqufJb6Z0SelqH/EnDWXl5 X-Received: by 2002:a62:ee0a:: with SMTP id e10mr76413202pfi.6.1555344409677; Mon, 15 Apr 2019 09:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555344409; cv=none; d=google.com; s=arc-20160816; b=qKzEUkM6bUCUvUBiFBSmkeY/bZq6Yf7HKAnsPI2Jt9v6SLHikV8gKDInRwcP5sufvE U99Rv8xOevYzkwk7+dygHgqna1MFVVIz3If3KFOF9bVAfMoGbp8HmglF7xFRdnPhQyfz 31EU/1aowWajPNh7QXVp+NydPC3rGyLdpWJqiwMfkaJsbRyWG1iAxIH/wBdgUcKS3a/a nbvVcAwwhPnfZ2dFAJ8dmnwoQDaAFf3NL1N446D9sY66GY1pgStaE+zYh52A5RquH6YM oi5kshgInXBYM83RiD+P2iL8yzjz0UuVDITycxB2PsDKd1nV/r6cQeg58u5rW7r2hNs9 Lqug== 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=MK89BfFuVrE+LPq36m4frmy3UmyjKRB0ojhczMQ6vSI=; b=MWkpj7tT8YlrbzH6AmxE6WWQYYizNl4q2LR1/kd5TcDsCN6PbVOavc8J9y9/Mts2Cb AnydeyywRA43QwLXYPSiV5eo8cp2hD6x6cNj8lISuWTa+0bzCHB2F9K5pxszfcJO8DZx Re0NElYNQC+Q7/wlGkRytsO8YkUjfZJ8IXO1PUZA01Ml9BkJAYSca8EFTBgxF/aDmvKy 53hrXg7z9DX0YPvSnY1B+wWrj9DM9bgooFo5fLsQ2SlJbzzwjcC+kqD/CECV+tHMdk1d qNPuGYH542nRXttdIo2klS193yl3jMrNGvGBU/ahtDAaGfjk7feUhXo0IcRqXQwzLtgD mhMg== 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 l11si22057406plb.370.2019.04.15.09.06.49; Mon, 15 Apr 2019 09:06:49 -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 S1728145AbfDOQGs (ORCPT + 30 others); Mon, 15 Apr 2019 12:06:48 -0400 Received: from foss.arm.com ([217.140.101.70]:38092 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728115AbfDOQGp (ORCPT ); Mon, 15 Apr 2019 12:06:45 -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 B46BF80D; Mon, 15 Apr 2019 09:06:44 -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 3AA223F68F; Mon, 15 Apr 2019 09:06:43 -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 34/36] [RFC] coresight: Pass coresight_device for coresight_release_platform_data Date: Mon, 15 Apr 2019 17:04:17 +0100 Message-Id: <1555344260-12375-35-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 As we prepare to expose the links between the devices in sysfs, pass the coresight_device instance to the coresight_release_platform_data in order to free up the connections when the device is removed. No functional changes as such in this patch. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose --- drivers/hwtracing/coresight/coresight-platform.c | 2 +- drivers/hwtracing/coresight/coresight-priv.h | 3 ++- drivers/hwtracing/coresight/coresight.c | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) -- 2.7.4 Reviewed-by: Mathieu Poirier diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index 224f698..6559c49 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -734,7 +734,7 @@ coresight_get_platform_data(struct device *dev) return pdata; /* Cleanup the connection information */ - coresight_release_platform_data(pdata); + coresight_release_platform_data(NULL, pdata); return ret; } EXPORT_SYMBOL_GPL(coresight_get_platform_data); diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h index 61d7f9f..bf28ca9 100644 --- a/drivers/hwtracing/coresight/coresight-priv.h +++ b/drivers/hwtracing/coresight/coresight-priv.h @@ -200,6 +200,7 @@ static inline void *coresight_get_uci_data(const struct amba_id *id) return 0; } -void coresight_release_platform_data(struct coresight_platform_data *pdata); +void coresight_release_platform_data(struct coresight_device *csdev, + struct coresight_platform_data *pdata); #endif diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index e3b9321..010bc86 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -1173,7 +1173,8 @@ postcore_initcall(coresight_init); * coresight_release_platform_data: Release references to the devices connected * to the output port of this device. */ -void coresight_release_platform_data(struct coresight_platform_data *pdata) +void coresight_release_platform_data(struct coresight_device *csdev, + struct coresight_platform_data *pdata) { int i; @@ -1275,7 +1276,7 @@ struct coresight_device *coresight_register(struct coresight_desc *desc) kfree(csdev); err_out: /* Cleanup the connection information */ - coresight_release_platform_data(desc->pdata); + coresight_release_platform_data(NULL, desc->pdata); return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(coresight_register); @@ -1285,7 +1286,7 @@ void coresight_unregister(struct coresight_device *csdev) etm_perf_del_symlink_sink(csdev); /* Remove references of that device in the topology */ coresight_remove_conns(csdev); - coresight_release_platform_data(csdev->pdata); + coresight_release_platform_data(csdev, csdev->pdata); device_unregister(&csdev->dev); } EXPORT_SYMBOL_GPL(coresight_unregister);