summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2016-10-29 21:24:36 -0400
committerLee Jones <lee.jones@linaro.org>2016-11-29 03:21:30 -0500
commit31cbae2224c189b54a198ba4c9e93fea30ed61f1 (patch)
treef9afb442b25a1102c189ee528eeb1b2f975ee5f3 /drivers/mfd
parent4be85fc4f8eabd0b265e1f891fe0e733bf01407a (diff)
mfd: ab8500-core: Make it explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/mfd/Kconfig:config AB8500_CORE drivers/mfd/Kconfig: bool "ST-Ericsson AB8500 Mixed Signal Power Management chip" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_init was not in use by this code, the init ordering remains unchanged with this commit. We replace module.h with moduleparam.h ; the latter since this file was implicitly relying on getting it. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/ab8500-core.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 589eebfc13df..6e00124cef01 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -14,7 +14,7 @@
14#include <linux/irqdomain.h> 14#include <linux/irqdomain.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/module.h> 17#include <linux/moduleparam.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/mfd/core.h> 19#include <linux/mfd/core.h>
20#include <linux/mfd/abx500.h> 20#include <linux/mfd/abx500.h>
@@ -123,6 +123,10 @@ static DEFINE_SPINLOCK(on_stat_lock);
123static u8 turn_on_stat_mask = 0xFF; 123static u8 turn_on_stat_mask = 0xFF;
124static u8 turn_on_stat_set; 124static u8 turn_on_stat_set;
125static bool no_bm; /* No battery management */ 125static bool no_bm; /* No battery management */
126/*
127 * not really modular, but the easiest way to keep compat with existing
128 * bootargs behaviour is to continue using module_param here.
129 */
126module_param(no_bm, bool, S_IRUGO); 130module_param(no_bm, bool, S_IRUGO);
127 131
128#define AB9540_MODEM_CTRL2_REG 0x23 132#define AB9540_MODEM_CTRL2_REG 0x23
@@ -1324,25 +1328,6 @@ static int ab8500_probe(struct platform_device *pdev)
1324 return ret; 1328 return ret;
1325} 1329}
1326 1330
1327static int ab8500_remove(struct platform_device *pdev)
1328{
1329 struct ab8500 *ab8500 = platform_get_drvdata(pdev);
1330
1331 if (((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
1332 ab8500->chip_id >= AB8500_CUT2P0) || is_ab8540(ab8500))
1333 sysfs_remove_group(&ab8500->dev->kobj, &ab9540_attr_group);
1334 else
1335 sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group);
1336
1337 if ((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
1338 ab8500->chip_id >= AB8500_CUT2P0)
1339 sysfs_remove_group(&ab8500->dev->kobj, &ab8505_attr_group);
1340
1341 mfd_remove_devices(ab8500->dev);
1342
1343 return 0;
1344}
1345
1346static const struct platform_device_id ab8500_id[] = { 1331static const struct platform_device_id ab8500_id[] = {
1347 { "ab8500-core", AB8500_VERSION_AB8500 }, 1332 { "ab8500-core", AB8500_VERSION_AB8500 },
1348 { "ab8505-i2c", AB8500_VERSION_AB8505 }, 1333 { "ab8505-i2c", AB8500_VERSION_AB8505 },
@@ -1354,9 +1339,9 @@ static const struct platform_device_id ab8500_id[] = {
1354static struct platform_driver ab8500_core_driver = { 1339static struct platform_driver ab8500_core_driver = {
1355 .driver = { 1340 .driver = {
1356 .name = "ab8500-core", 1341 .name = "ab8500-core",
1342 .suppress_bind_attrs = true,
1357 }, 1343 },
1358 .probe = ab8500_probe, 1344 .probe = ab8500_probe,
1359 .remove = ab8500_remove,
1360 .id_table = ab8500_id, 1345 .id_table = ab8500_id,
1361}; 1346};
1362 1347
@@ -1364,14 +1349,4 @@ static int __init ab8500_core_init(void)
1364{ 1349{
1365 return platform_driver_register(&ab8500_core_driver); 1350 return platform_driver_register(&ab8500_core_driver);
1366} 1351}
1367
1368static void __exit ab8500_core_exit(void)
1369{
1370 platform_driver_unregister(&ab8500_core_driver);
1371}
1372core_initcall(ab8500_core_init); 1352core_initcall(ab8500_core_init);
1373module_exit(ab8500_core_exit);
1374
1375MODULE_AUTHOR("Mattias Wallin, Srinidhi Kasagar, Rabin Vincent");
1376MODULE_DESCRIPTION("AB8500 MFD core");
1377MODULE_LICENSE("GPL v2");