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

Re: [PATCH v7 13/25] coresight: tmc: allow tmc to be built as a module

From: Suzuki K Poulose <suzuki.poulose@arm.com>
Date: 2020-08-06 14:54:43

On 08/05/2020 04:49 PM, Suzuki K Poulose wrote:
On 08/05/2020 03:54 AM, Tingwei Zhang wrote:
quoted
From: Kim Phillips <redacted>

Allow to build coresight-tmc as a module, for ease of development.

- Kconfig becomes a tristate, to allow =m
- append -core to source file name to allow module to
   be called coresight-tmc by the Makefile
- add an tmc_remove function, for module unload
- add a MODULE_DEVICE_TABLE for autoloading on boot

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Leo Yan <redacted>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Randy Dunlap <redacted>
Cc: Suzuki K Poulose <Suzuki.Poulose@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Kim Phillips <redacted>
Signed-off-by: Tingwei Zhang <redacted>
Tested-by: Mike Leach <redacted>
---
  drivers/hwtracing/coresight/Kconfig           |  6 +++++-
  drivers/hwtracing/coresight/Makefile          |  6 +++---
  .../{coresight-tmc.c => coresight-tmc-core.c} | 19 ++++++++++++++++++-
  3 files changed, 26 insertions(+), 5 deletions(-)
  rename drivers/hwtracing/coresight/{coresight-tmc.c => 
coresight-tmc-core.c} (96%)
quoted
diff --git a/drivers/hwtracing/coresight/coresight-tmc.c 
b/drivers/hwtracing/coresight/coresight-tmc-core.c
similarity index 96%
rename from drivers/hwtracing/coresight/coresight-tmc.c
rename to drivers/hwtracing/coresight/coresight-tmc-core.c
index 7040d583bed9..29d191ba7ccf 100644
--- a/drivers/hwtracing/coresight/coresight-tmc.c
+++ b/drivers/hwtracing/coresight/coresight-tmc-core.c
@@ -561,6 +561,16 @@ static void tmc_shutdown(struct amba_device *adev)
      spin_unlock_irqrestore(&drvdata->spinlock, flags);
  }
+static int __exit tmc_remove(struct amba_device *adev)
+{
+    struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev);
+
+    misc_deregister(&drvdata->miscdev);
+    coresight_unregister(drvdata->csdev);
Same comment as the etb10 driver. Will check this out.
As with the etb10 driver, with the comment added here:

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>

Suzuki

_______________________________________________
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