diff mbox series

[v2,34/36,RFC] coresight: Pass coresight_device for coresight_release_platform_data

Message ID 1555344260-12375-35-git-send-email-suzuki.poulose@arm.com (mailing list archive)
State RFC
Headers show
Series coresight: Support for ACPI bindings | expand

Commit Message

Suzuki K Poulose April 15, 2019, 4:04 p.m. UTC
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 <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 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(-)

Comments

Mathieu Poirier April 29, 2019, 5:40 p.m. UTC | #1
On Mon, Apr 15, 2019 at 05:04:17PM +0100, Suzuki K Poulose wrote:
> 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 <mathieu.poirier@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
>  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(-)
> 
> 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);

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>

> -- 
> 2.7.4
>
diff mbox series

Patch

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);