drivers/hwtracing: make coresight-* explicitly non-modular
Subsystems (3)
PATCH 1/1 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.
---
[This is what I sent back in October[1], but with the .remove and
.suppress bits stripped out, since that is now in Mathieu's queue. And to make this a standalone commit that Mathieu can also add to his queue, I've squished the amba/bus.h change[2] into this change.]
[1] http://www.spinics.net/lists/kernel/msg2096702.html
[2] http://lkml.iu.edu/hypermail/linux/kernel/1510.1/02464.html
drivers/hwtracing/coresight/coresight-etb10.c | 9 +++------ drivers/hwtracing/coresight/coresight-etm3x.c | 14 ++++++++------ drivers/hwtracing/coresight/coresight-etm4x.c | 4 +--- drivers/hwtracing/coresight/coresight-funnel.c | 9 +++------ drivers/hwtracing/coresight/coresight-replicator-qcom.c | 4 +--- drivers/hwtracing/coresight/coresight-replicator.c | 7 ++----- drivers/hwtracing/coresight/coresight-tmc.c | 9 +++------ drivers/hwtracing/coresight/coresight-tpiu.c | 9 +++------ drivers/hwtracing/coresight/coresight.c | 3 --- drivers/hwtracing/coresight/of_coresight.c | 1 - include/linux/amba/bus.h | 9 +++++++++ 11 files changed, 33 insertions(+), 45 deletions(-)
drivers/hwtracing/coresight/coresight-etb10.c +3 -6
@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Embedded Trace Buffer driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation.
@@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h>
@@ -534,8 +535,4 @@ static struct amba_driver etb_driver = { .probe = etb_probe, .id_table = etb_ids, }; - -module_amba_driver (etb_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Embedded Trace Buffer driver" ); +builtin_amba_driver (etb_driver);
drivers/hwtracing/coresight/coresight-etm3x.c +8 -6
@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Program Flow Trace driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation.
@@ -11,7 +13,7 @@*/ #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h>
@@ -35,6 +37,10 @@#include "coresight-etm.h" +/* +* not really modular but using module_param is the easiest way to +* remain consistent with existing use cases for now. +*/ static int boot_enable;module_param_named (boot_enable, boot_enable, int,S_IRUGO );
@@ -1950,8 +1956,4 @@ static struct amba_driver etm_driver = { .probe = etm_probe, .id_table = etm_ids, }; - -module_amba_driver (etm_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Program Flow Trace driver" ); +builtin_amba_driver (etm_driver);
drivers/hwtracing/coresight/coresight-etm4x.c +1 -3
@@ -15,7 +15,6 @@#include <linux/init.h> #include <linux/types.h> #include <linux/device.h> -#include <linux/module.h> #include <linux/io.h> #include <linux/err.h> #include <linux/fs.h>
@@ -2714,5 +2713,4 @@ static struct amba_driver etm4x_driver = { .probe = etm4_probe, .id_table = etm4_ids, }; - -module_amba_driver (etm4x_driver); +builtin_amba_driver (etm4x_driver);
drivers/hwtracing/coresight/coresight-funnel.c +3 -6
@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Funnel driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation.
@@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h>
@@ -270,8 +271,4 @@ static struct amba_driver funnel_driver = { .probe = funnel_probe, .id_table = funnel_ids, }; - -module_amba_driver (funnel_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Funnel driver" ); +builtin_amba_driver (funnel_driver);
drivers/hwtracing/coresight/coresight-replicator-qcom.c +1 -3
@@ -15,7 +15,6 @@#include <linux/clk.h> #include <linux/coresight.h> #include <linux/device.h> -#include <linux/module.h> #include <linux/err.h> #include <linux/init.h> #include <linux/io.h>
@@ -202,5 +201,4 @@ static struct amba_driver replicator_driver = { .probe = replicator_probe, .id_table = replicator_ids, }; - -module_amba_driver (replicator_driver); +builtin_amba_driver (replicator_driver);
drivers/hwtracing/coresight/coresight-replicator.c +2 -5
@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Replicator driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation.
@@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/device.h> #include <linux/platform_device.h> #include <linux/io.h>
@@ -168,8 +169,4 @@ static struct platform_driver replicator_driver = { .suppress_bind_attrs = true, }, }; -builtin_platform_driver (replicator_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Replicator driver" );
drivers/hwtracing/coresight/coresight-tmc.c +3 -6
@@ -1,5 +1,7 @@/* Copyright (c) 2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Trace Memory Controller driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation.
@@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h>
@@ -787,8 +788,4 @@ static struct amba_driver tmc_driver = { .probe = tmc_probe, .id_table = tmc_ids, }; - -module_amba_driver (tmc_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Trace Memory Controller driver" ); +builtin_amba_driver (tmc_driver);
drivers/hwtracing/coresight/coresight-tpiu.c +3 -6
@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Trace Port Interface Unit driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation.
@@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/device.h> #include <linux/io.h>
@@ -220,8 +221,4 @@ static struct amba_driver tpiu_driver = { .probe = tpiu_probe, .id_table = tpiu_ids, }; - -module_amba_driver (tpiu_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Trace Port Interface Unit driver" ); +builtin_amba_driver (tpiu_driver);
drivers/hwtracing/coresight/coresight.c +0 -3
@@ -11,7 +11,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h>
@@ -766,5 +765,3 @@ void coresight_unregister(struct coresight_device *csdev)device_unregister (&csdev->dev); }EXPORT_SYMBOL_GPL (coresight_unregister); - -MODULE_LICENSE ("GPL v2" );
drivers/hwtracing/coresight/of_coresight.c +0 -1
@@ -10,7 +10,6 @@* GNU General Public License for more details. */ -#include <linux/module.h> #include <linux/types.h> #include <linux/err.h> #include <linux/slab.h>
include/linux/amba/bus.h +9 -0
@@ -163,4 +163,13 @@ struct amba_device name##_device = { \#define module_amba_driver (__amba_drv) \ module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) +/* +* builtin_amba_driver() - Helper macro for drivers that don't do anything +* special in driver initcall. This eliminates a lot of boilerplate. Each +* driver may only use this macro once, and calling it replaces the instance +* device_initcall(). +*/ +#define builtin_amba_driver (__amba_drv) \ + builtin_driver(__amba_drv, amba_driver_register) +#endif
Signature · 1 line
2.6.1
Quoted 337 lines · Paul Gortmaker
None of the
Kconfigcurrently 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) deletemodule.hinclude where unused, and (3) relocate the description into the comments so we don't needMODULE_DESCRIPTIONand associated tags.The etm3x and etm4x use
module_param_named, and have been adjusted to just includemoduleparam.hfor that purpose.In commit
f309d4443130bf814e991f836e919dca22df37ae("platform_device:
better support builtin boilerplate avoidance") we introduced thebuiltin_drivermacro.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 asbuiltin_amba_driver()the init ordering remains unchanged with this commit.Cc Mathieu Poirier <[email protected]>Cc linux-arm-kernel at lists.infradead.orgSigned-off-by Paul Gortmaker <[email protected]>---
[This is what I sent back in October[1], but with the .remove and
.suppress bits stripped out, since that is now in Mathieu's queue. And to make this a standalone commit that Mathieu can also add to his queue, I've squished theamba/bus.hchange[2] into this change.][1] http://www.spinics.net/lists/kernel/msg2096702.html
[2] http://lkml.iu.edu/hypermail/linux/kernel/1510.1/02464.htmldrivers/hwtracing/coresight/coresight-etb10.c | 9 +++------ drivers/hwtracing/coresight/coresight-etm3x.c | 14 ++++++++------ drivers/hwtracing/coresight/coresight-etm4x.c | 4 +--- drivers/hwtracing/coresight/coresight-funnel.c | 9 +++------ drivers/hwtracing/coresight/coresight-replicator-qcom.c | 4 +--- drivers/hwtracing/coresight/coresight-replicator.c | 7 ++----- drivers/hwtracing/coresight/coresight-tmc.c | 9 +++------ drivers/hwtracing/coresight/coresight-tpiu.c | 9 +++------ drivers/hwtracing/coresight/coresight.c | 3 --- drivers/hwtracing/coresight/of_coresight.c | 1 - include/linux/amba/bus.h | 9 +++++++++ 11 files changed, 33 insertions(+), 45 deletions(-)drivers/hwtracing/coresight/coresight-etb10.c +3
-6@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Embedded Trace Buffer driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h> @@ -534,8 +535,4 @@ static struct amba_driver etb_driver = { .probe = etb_probe, .id_table = etb_ids, }; - -module_amba_driver (etb_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Embedded Trace Buffer driver" ); +builtin_amba_driver (etb_driver);drivers/hwtracing/coresight/coresight-etm3x.c +8
-6@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Program Flow Trace driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -11,7 +13,7 @@*/ #include <linux/kernel.h> -#include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h> @@ -35,6 +37,10 @@#include "coresight-etm.h" +/* +* not really modular but using module_param is the easiest way to +* remain consistent with existing use cases for now. +*/ static int boot_enable;module_param_named (boot_enable, boot_enable, int,S_IRUGO );@@ -1950,8 +1956,4 @@ static struct amba_driver etm_driver = { .probe = etm_probe, .id_table = etm_ids, }; - -module_amba_driver (etm_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Program Flow Trace driver" ); +builtin_amba_driver (etm_driver);drivers/hwtracing/coresight/coresight-etm4x.c +1
-3@@ -15,7 +15,6 @@#include <linux/init.h> #include <linux/types.h> #include <linux/device.h> -#include <linux/module.h> #include <linux/io.h> #include <linux/err.h> #include <linux/fs.h> @@ -2714,5 +2713,4 @@ static struct amba_driver etm4x_driver = { .probe = etm4_probe, .id_table = etm4_ids, }; - -module_amba_driver (etm4x_driver); +builtin_amba_driver (etm4x_driver);drivers/hwtracing/coresight/coresight-funnel.c +3
-6@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Funnel driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h> @@ -270,8 +271,4 @@ static struct amba_driver funnel_driver = { .probe = funnel_probe, .id_table = funnel_ids, }; - -module_amba_driver (funnel_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Funnel driver" ); +builtin_amba_driver (funnel_driver);drivers/hwtracing/coresight/coresight-replicator-qcom.c +1
-3@@ -15,7 +15,6 @@#include <linux/clk.h> #include <linux/coresight.h> #include <linux/device.h> -#include <linux/module.h> #include <linux/err.h> #include <linux/init.h> #include <linux/io.h> @@ -202,5 +201,4 @@ static struct amba_driver replicator_driver = { .probe = replicator_probe, .id_table = replicator_ids, }; - -module_amba_driver (replicator_driver); +builtin_amba_driver (replicator_driver);drivers/hwtracing/coresight/coresight-replicator.c +2
-5@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Replicator driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/device.h> #include <linux/platform_device.h> #include <linux/io.h> @@ -168,8 +169,4 @@ static struct platform_driver replicator_driver = { .suppress_bind_attrs = true, }, }; -builtin_platform_driver (replicator_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Replicator driver" );drivers/hwtracing/coresight/coresight-tmc.c +3
-6@@ -1,5 +1,7 @@/* Copyright (c) 2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Trace Memory Controller driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h> @@ -787,8 +788,4 @@ static struct amba_driver tmc_driver = { .probe = tmc_probe, .id_table = tmc_ids, }; - -module_amba_driver (tmc_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Trace Memory Controller driver" ); +builtin_amba_driver (tmc_driver);drivers/hwtracing/coresight/coresight-tpiu.c +3
-6@@ -1,5 +1,7 @@/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * +* Description: CoreSight Trace Port Interface Unit driver +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. @@ -11,7 +13,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/device.h> #include <linux/io.h> @@ -220,8 +221,4 @@ static struct amba_driver tpiu_driver = { .probe = tpiu_probe, .id_table = tpiu_ids, }; - -module_amba_driver (tpiu_driver); - -MODULE_LICENSE ("GPL v2" ); -MODULE_DESCRIPTION ("CoreSight Trace Port Interface Unit driver" ); +builtin_amba_driver (tpiu_driver);drivers/hwtracing/coresight/coresight.c +0
-3@@ -11,7 +11,6 @@*/ #include <linux/kernel.h> -#include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/device.h> @@ -766,5 +765,3 @@ void coresight_unregister(struct coresight_device *csdev)device_unregister (&csdev->dev); }EXPORT_SYMBOL_GPL (coresight_unregister); - -MODULE_LICENSE ("GPL v2" );drivers/hwtracing/coresight/of_coresight.c +0
-1@@ -10,7 +10,6 @@* GNU General Public License for more details. */ -#include <linux/module.h> #include <linux/types.h> #include <linux/err.h> #include <linux/slab.h> include/linux/amba/bus.h +9
-1@@ -163,4 +163,13 @@ struct amba_device name##_device = { \#define module_amba_driver (__amba_drv) \ module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) +/* +* builtin_amba_driver() - Helper macro for drivers that don't do anything +* special in driver initcall. This eliminates a lot of boilerplate. Each +* driver may only use this macro once, and calling it replaces the instance +* device_initcall(). +*/ +#define builtin_amba_driver (__amba_drv) \ + builtin_driver(__amba_drv, amba_driver_register) +#endif --
Quoted 2 lines
2.6.1
I'm good with this patch on the CS side but Russell maintains the amba subsystem and as such needs to agree with the new macro. Russell, I offer to take this through my tree if you're fine with the changes.
Thanks,
Mathieu
Russell King - ARM Linux
Acked-by Russell KingQuoted 19 lines · Mathieu Poirier
Quoted 17 lines · Paul Gortmaker
include/linux/amba/bus.h +9
-0@@ -163,4 +163,13 @@ struct amba_device name##_device = { \#define module_amba_driver (__amba_drv) \ module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) +/* +* builtin_amba_driver() - Helper macro for drivers that don't do anything +* special in driver initcall. This eliminates a lot of boilerplate. Each +* driver may only use this macro once, and calling it replaces the instance +* device_initcall(). +*/ +#define builtin_amba_driver (__amba_drv) \ + builtin_driver(__amba_drv, amba_driver_register) +
Quoted 8 lines
Quoted 4 lines
include/linux/amba/bus.h +0
-1#endif --2.6.1
I'm good with this patch on the CS side but Russell maintains the amba subsystem and as such needs to agree with the new macro. Russell, I offer to take this through my tree if you're fine with the changes.
Signature · 3 lines
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.
Quoted 29 lines · Russell King - ARM Linux
Quoted 19 lines · Mathieu Poirier
Quoted 17 lines · Paul Gortmaker
include/linux/amba/bus.h +9
-0@@ -163,4 +163,13 @@ struct amba_device name##_device = { \#define module_amba_driver (__amba_drv) \ module_driver(__amba_drv, amba_driver_register, amba_driver_unregister) +/* +* builtin_amba_driver() - Helper macro for drivers that don't do anything +* special in driver initcall. This eliminates a lot of boilerplate. Each +* driver may only use this macro once, and calling it replaces the instance +* device_initcall(). +*/ +#define builtin_amba_driver (__amba_drv) \ + builtin_driver(__amba_drv, amba_driver_register) +Quoted 8 lines
Quoted 4 lines
include/linux/amba/bus.h +0
-1#endif --2.6.1
I'm good with this patch on the CS side but Russell maintains the amba subsystem and as such needs to agree with the new macro. Russell, I offer to take this through my tree if you're fine with the changes.
Quoted 2 lines
Acked-by Russell King <[email protected]>
Applied - thanks.
Quoted 4 lines
--
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.