Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/hwtracing: make coresight-* explicitly non-modular

None of the Kconfig currently controlling compilation of any of
the files here are tristate, meaning that none of it currently
is being built as a module by anyone.

We need not be concerned about .remove functions and blocking the
unbind sysfs operations, since that was already done in a recent
commit.

Lets remove any remaining modular references, so that when reading the
drivers there is no doubt they are builtin-only.

All drivers get mostly the same changes, so they are handled in batch.
Changes are (1) convert to builtin_amba_driver, (2) delete module.h
include where unused, and (3) relocate the description into the
comments so we don't need MODULE_DESCRIPTION and associated tags.

The etm3x and etm4x use module_param_named, and have been adjusted
to just include moduleparam.h for that purpose.

In commit f309d4443130bf814e991f836e919dca22df37ae ("platform_device:
better support builtin boilerplate avoidance") we introduced the
builtin_driver macro.

Here we use that support and extend it to amba driver registration,
so where a driver is clearly non-modular and builtin-only, we can
update with the simple mapping of

module_amba_driver(...) ---> builtin_amba_driver(...)

Since module_amba_driver() uses the same init level priority as
builtin_amba_driver() the init ordering remains unchanged with
this commit.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Paul Gortmaker and committed by
Greg Kroah-Hartman
941943cf 17534ceb

+33 -45
+3 -6
drivers/hwtracing/coresight/coresight-etb10.c
··· 1 1 /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 2 * 3 + * Description: CoreSight Embedded Trace Buffer driver 4 + * 3 5 * This program is free software; you can redistribute it and/or modify 4 6 * it under the terms of the GNU General Public License version 2 and 5 7 * only version 2 as published by the Free Software Foundation. ··· 14 12 15 13 #include <asm/local.h> 16 14 #include <linux/kernel.h> 17 - #include <linux/module.h> 18 15 #include <linux/init.h> 19 16 #include <linux/types.h> 20 17 #include <linux/device.h> ··· 782 781 .probe = etb_probe, 783 782 .id_table = etb_ids, 784 783 }; 785 - 786 - module_amba_driver(etb_driver); 787 - 788 - MODULE_LICENSE("GPL v2"); 789 - MODULE_DESCRIPTION("CoreSight Embedded Trace Buffer driver"); 784 + builtin_amba_driver(etb_driver);
+8 -6
drivers/hwtracing/coresight/coresight-etm3x.c
··· 1 1 /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 2 * 3 + * Description: CoreSight Program Flow Trace driver 4 + * 3 5 * This program is free software; you can redistribute it and/or modify 4 6 * it under the terms of the GNU General Public License version 2 and 5 7 * only version 2 as published by the Free Software Foundation. ··· 13 11 */ 14 12 15 13 #include <linux/kernel.h> 16 - #include <linux/module.h> 14 + #include <linux/moduleparam.h> 17 15 #include <linux/init.h> 18 16 #include <linux/types.h> 19 17 #include <linux/device.h> ··· 40 38 #include "coresight-etm.h" 41 39 #include "coresight-etm-perf.h" 42 40 41 + /* 42 + * Not really modular but using module_param is the easiest way to 43 + * remain consistent with existing use cases for now. 44 + */ 43 45 static int boot_enable; 44 46 module_param_named(boot_enable, boot_enable, int, S_IRUGO); 45 47 ··· 918 912 .probe = etm_probe, 919 913 .id_table = etm_ids, 920 914 }; 921 - 922 - module_amba_driver(etm_driver); 923 - 924 - MODULE_LICENSE("GPL v2"); 925 - MODULE_DESCRIPTION("CoreSight Program Flow Trace driver"); 915 + builtin_amba_driver(etm_driver);
+1 -3
drivers/hwtracing/coresight/coresight-etm4x.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/types.h> 17 17 #include <linux/device.h> 18 - #include <linux/module.h> 19 18 #include <linux/io.h> 20 19 #include <linux/err.h> 21 20 #include <linux/fs.h> ··· 2709 2710 .probe = etm4_probe, 2710 2711 .id_table = etm4_ids, 2711 2712 }; 2712 - 2713 - module_amba_driver(etm4x_driver); 2713 + builtin_amba_driver(etm4x_driver);
+3 -6
drivers/hwtracing/coresight/coresight-funnel.c
··· 1 1 /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 2 * 3 + * Description: CoreSight Funnel driver 4 + * 3 5 * This program is free software; you can redistribute it and/or modify 4 6 * it under the terms of the GNU General Public License version 2 and 5 7 * only version 2 as published by the Free Software Foundation. ··· 13 11 */ 14 12 15 13 #include <linux/kernel.h> 16 - #include <linux/module.h> 17 14 #include <linux/init.h> 18 15 #include <linux/types.h> 19 16 #include <linux/device.h> ··· 269 268 .probe = funnel_probe, 270 269 .id_table = funnel_ids, 271 270 }; 272 - 273 - module_amba_driver(funnel_driver); 274 - 275 - MODULE_LICENSE("GPL v2"); 276 - MODULE_DESCRIPTION("CoreSight Funnel driver"); 271 + builtin_amba_driver(funnel_driver);
+1 -3
drivers/hwtracing/coresight/coresight-replicator-qcom.c
··· 15 15 #include <linux/clk.h> 16 16 #include <linux/coresight.h> 17 17 #include <linux/device.h> 18 - #include <linux/module.h> 19 18 #include <linux/err.h> 20 19 #include <linux/init.h> 21 20 #include <linux/io.h> ··· 197 198 .probe = replicator_probe, 198 199 .id_table = replicator_ids, 199 200 }; 200 - 201 - module_amba_driver(replicator_driver); 201 + builtin_amba_driver(replicator_driver);
+2 -5
drivers/hwtracing/coresight/coresight-replicator.c
··· 1 1 /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 2 * 3 + * Description: CoreSight Replicator driver 4 + * 3 5 * This program is free software; you can redistribute it and/or modify 4 6 * it under the terms of the GNU General Public License version 2 and 5 7 * only version 2 as published by the Free Software Foundation. ··· 13 11 */ 14 12 15 13 #include <linux/kernel.h> 16 - #include <linux/module.h> 17 14 #include <linux/device.h> 18 15 #include <linux/platform_device.h> 19 16 #include <linux/io.h> ··· 167 166 .suppress_bind_attrs = true, 168 167 }, 169 168 }; 170 - 171 169 builtin_platform_driver(replicator_driver); 172 - 173 - MODULE_LICENSE("GPL v2"); 174 - MODULE_DESCRIPTION("CoreSight Replicator driver");
+3 -6
drivers/hwtracing/coresight/coresight-tmc.c
··· 1 1 /* Copyright (c) 2012, The Linux Foundation. All rights reserved. 2 2 * 3 + * Description: CoreSight Trace Memory Controller driver 4 + * 3 5 * This program is free software; you can redistribute it and/or modify 4 6 * it under the terms of the GNU General Public License version 2 and 5 7 * only version 2 as published by the Free Software Foundation. ··· 13 11 */ 14 12 15 13 #include <linux/kernel.h> 16 - #include <linux/module.h> 17 14 #include <linux/init.h> 18 15 #include <linux/types.h> 19 16 #include <linux/device.h> ··· 783 782 .probe = tmc_probe, 784 783 .id_table = tmc_ids, 785 784 }; 786 - 787 - module_amba_driver(tmc_driver); 788 - 789 - MODULE_LICENSE("GPL v2"); 790 - MODULE_DESCRIPTION("CoreSight Trace Memory Controller driver"); 785 + builtin_amba_driver(tmc_driver);
+3 -6
drivers/hwtracing/coresight/coresight-tpiu.c
··· 1 1 /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. 2 2 * 3 + * Description: CoreSight Trace Port Interface Unit driver 4 + * 3 5 * This program is free software; you can redistribute it and/or modify 4 6 * it under the terms of the GNU General Public License version 2 and 5 7 * only version 2 as published by the Free Software Foundation. ··· 13 11 */ 14 12 15 13 #include <linux/kernel.h> 16 - #include <linux/module.h> 17 14 #include <linux/init.h> 18 15 #include <linux/device.h> 19 16 #include <linux/io.h> ··· 219 218 .probe = tpiu_probe, 220 219 .id_table = tpiu_ids, 221 220 }; 222 - 223 - module_amba_driver(tpiu_driver); 224 - 225 - MODULE_LICENSE("GPL v2"); 226 - MODULE_DESCRIPTION("CoreSight Trace Port Interface Unit driver"); 221 + builtin_amba_driver(tpiu_driver);
-3
drivers/hwtracing/coresight/coresight.c
··· 11 11 */ 12 12 13 13 #include <linux/kernel.h> 14 - #include <linux/module.h> 15 14 #include <linux/init.h> 16 15 #include <linux/types.h> 17 16 #include <linux/device.h> ··· 893 894 device_unregister(&csdev->dev); 894 895 } 895 896 EXPORT_SYMBOL_GPL(coresight_unregister); 896 - 897 - MODULE_LICENSE("GPL v2");
-1
drivers/hwtracing/coresight/of_coresight.c
··· 10 10 * GNU General Public License for more details. 11 11 */ 12 12 13 - #include <linux/module.h> 14 13 #include <linux/types.h> 15 14 #include <linux/err.h> 16 15 #include <linux/slab.h>
+9
include/linux/amba/bus.h
··· 163 163 #define module_amba_driver(__amba_drv) \ 164 164 module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) 165 165 166 + /* 167 + * builtin_amba_driver() - Helper macro for drivers that don't do anything 168 + * special in driver initcall. This eliminates a lot of boilerplate. Each 169 + * driver may only use this macro once, and calling it replaces the instance 170 + * device_initcall(). 171 + */ 172 + #define builtin_amba_driver(__amba_drv) \ 173 + builtin_driver(__amba_drv, amba_driver_register) 174 + 166 175 #endif