]> git.baikalelectronics.ru Git - kernel.git/commitdiff
coresight: Pass coresight_device for coresight_release_platform_data
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 18 May 2020 18:02:20 +0000 (12:02 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 May 2020 14:31:15 +0000 (16:31 +0200)
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.

Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20200518180242.7916-2-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-platform.c
drivers/hwtracing/coresight/coresight-priv.h
drivers/hwtracing/coresight/coresight.c

index 43418a2126ffec77e70c8c1043cbaea5e50fff73..4b78e1ac52853d8cdbcfdfdb8851d4662b572a41 100644 (file)
@@ -822,7 +822,7 @@ coresight_get_platform_data(struct device *dev)
 error:
        if (!IS_ERR_OR_NULL(pdata))
                /* Cleanup the connection information */
-               coresight_release_platform_data(pdata);
+               coresight_release_platform_data(NULL, pdata);
        return ERR_PTR(ret);
 }
 EXPORT_SYMBOL_GPL(coresight_get_platform_data);
index 890f9a5c97c6a1cd0ff0ecb2dbacd5fc61a5daba..1cad642f27aa749d8d6b4cb6a007d89e197b9e5b 100644 (file)
@@ -211,7 +211,8 @@ 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);
 struct coresight_device *
 coresight_find_csdev_by_fwnode(struct fwnode_handle *r_fwnode);
 void coresight_set_assoc_ectdev_mutex(struct coresight_device *csdev,
index c71553c09f8ef95de26c904041f7cc08b6d8e135..10e756410d3c44511d50ab7b012000fb1ed12787 100644 (file)
@@ -1213,7 +1213,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;
 
@@ -1316,7 +1317,7 @@ err_free_csdev:
        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);
@@ -1326,7 +1327,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);