summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Yan <leo.yan@arm.com>2026-02-09 15:44:40 +0300
committerSuzuki K Poulose <suzuki.poulose@arm.com>2026-02-25 14:14:45 +0300
commiteef33a7cce239783d0422526a4d786289a936f1b (patch)
treeff6a25eef26ed404d3eb167ce1e840588b0c9e77
parent8573756b235ddfa005837a958241caf204696a0a (diff)
downloadlinux-eef33a7cce239783d0422526a4d786289a936f1b.tar.xz
coresight: Unify bus unregistration via coresight_unregister()
Once a device is successfully registered, set the "registered" flag to true. After that point, all failures jump to the out_unlock label to unwind the flow via coresight_unregister(). Since failure handling is unified, the comment about resource release for the etm_perf_add_symlink_sink() failure is no need, remove it. Signed-off-by: Leo Yan <leo.yan@arm.com> Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20260209-arm_coresight_refactor_dev_register-v4-8-62d6042f76f7@arm.com
-rw-r--r--drivers/hwtracing/coresight/coresight-core.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index e04545295240..46f247f73cf6 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -1383,20 +1383,13 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
goto out_unlock;
}
- ret = etm_perf_add_symlink_sink(csdev);
-
- /*
- * As with the above, all resources are free'd explicitly via
- * coresight_device_release() triggered from put_device(), which is in
- * turn called from function device_unregister().
- */
- if (ret && ret != -EOPNOTSUPP) {
- device_unregister(&csdev->dev);
- goto out_unlock;
- }
/* Device is now registered */
registered = true;
+ ret = etm_perf_add_symlink_sink(csdev);
+ if (ret && ret != -EOPNOTSUPP)
+ goto out_unlock;
+
ret = coresight_create_conns_sysfs_group(csdev);
if (ret)
goto out_unlock;