Thread (63 messages) flat view 63 messages, 6 authors, 2020-08-07

Re: [PATCH v7 23/25] coresight: tmc-etr: add function to register catu ops

From: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: 2020-08-05 16:06:16

On 08/05/2020 03:54 AM, Tingwei Zhang wrote:
quoted hunk ↗ jump to hunk
From: Mian Yousaf Kaukab <redacted>

Make etr_catu_buf_ops static. Instead of directly accessing it in
etr_buf_ops[], add a function to let catu driver register the ops at
runtime. Break circular dependency between tmc-etr and catu drivers.

Signed-off-by: Mian Yousaf Kaukab <redacted>
Signed-off-by: Tingwei Zhang <redacted>
---
  drivers/hwtracing/coresight/coresight-catu.c  | 22 +++++++++++++++++--
  drivers/hwtracing/coresight/coresight-catu.h  |  2 --
  .../hwtracing/coresight/coresight-tmc-etr.c   | 15 +++++++++++--
  drivers/hwtracing/coresight/coresight-tmc.h   |  3 +++
  4 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
index 1801804a7762..47696a7d24a7 100644
--- a/drivers/hwtracing/coresight/coresight-catu.c
+++ b/drivers/hwtracing/coresight/coresight-catu.c
@@ -358,7 +358,7 @@ static int catu_alloc_etr_buf(struct tmc_drvdata *tmc_drvdata,
  	return 0;
  }
  
-const struct etr_buf_operations etr_catu_buf_ops = {
+static const struct etr_buf_operations etr_catu_buf_ops = {
  	.alloc = catu_alloc_etr_buf,
  	.free = catu_free_etr_buf,
  	.sync = catu_sync_etr_buf,
@@ -582,4 +582,22 @@ static struct amba_driver catu_driver = {
  	.id_table			= catu_ids,
  };
  
-builtin_amba_driver(catu_driver);
+static int __init catu_init(void)
+{
+	int ret;
+
+	ret = amba_driver_register(&catu_driver);
+	if (ret)
+		pr_info("Error registering catu driver\n");
+	tmc_etr_set_catu_ops(&etr_catu_buf_ops);
+	return ret;
+}
+
+static void __exit catu_exit(void)
+{
+	tmc_etr_remove_catu_ops();
+	amba_driver_unregister(&catu_driver);
+}
+
+module_init(catu_init);
+module_exit(catu_exit);
Please add :


MODULE_AUTHOR("Suzuki K Poulose [off-list ref]");
MODULE_DESCRIPTION("Arm CoreSight Address Translation Unit driver");
MODULE_LICENSE("GPL v2");

With that

Reviewed-by : Suzuki K Poulose [off-list ref]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help