On 08/05/2020 03:54 AM, Tingwei Zhang wrote:
From: Kim Phillips kim.phillips@arm.com
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 leo.yan@linaro.org Cc: Alexander Shishkin alexander.shishkin@linux.intel.com Cc: Randy Dunlap rdunlap@infradead.org 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 kim.phillips@arm.com Signed-off-by: Tingwei Zhang tingwei@codeaurora.org Tested-by: Mike Leach mike.leach@linaro.org
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%)
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.
Suzuki