summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/adp5520.c
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2019-01-13 13:36:33 -0500
committerLee Jones <lee.jones@linaro.org>2019-02-01 03:21:13 -0500
commit6b09274bacc76101293d6d8ccbded51448b11fd1 (patch)
tree3225606785a0f116a58593d07e9b7c1fd22b21f6 /drivers/mfd/adp5520.c
parent17f808a7fec32cf3610f92a095b562c915fd254a (diff)
mfd: adp5520: Make it explicitly non-modular
The Makefile/Kconfig currently controlling compilation of this code is: drivers/mfd/Makefile:obj-$(CONFIG_PMIC_ADP5520) += adp5520.o drivers/mfd/Kconfig:config PMIC_ADP5520 drivers/mfd/Kconfig: bool "Analog Devices ADP5520/01 MFD PMIC Core Support" ...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_i2c_driver() uses the same init level priority as builtin_i2c_driver() the init ordering remains unchanged with this commit. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) 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> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/adp5520.c')
-rw-r--r--drivers/mfd/adp5520.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index be0497b96720..2cdd39cb8a18 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -7,6 +7,8 @@
7 * 7 *
8 * Copyright 2009 Analog Devices Inc. 8 * Copyright 2009 Analog Devices Inc.
9 * 9 *
10 * Author: Michael Hennerich <michael.hennerich@analog.com>
11 *
10 * Derived from da903x: 12 * Derived from da903x:
11 * Copyright (C) 2008 Compulab, Ltd. 13 * Copyright (C) 2008 Compulab, Ltd.
12 * Mike Rapoport <mike@compulab.co.il> 14 * Mike Rapoport <mike@compulab.co.il>
@@ -18,7 +20,7 @@
18 */ 20 */
19 21
20#include <linux/kernel.h> 22#include <linux/kernel.h>
21#include <linux/module.h> 23#include <linux/init.h>
22#include <linux/platform_device.h> 24#include <linux/platform_device.h>
23#include <linux/slab.h> 25#include <linux/slab.h>
24#include <linux/interrupt.h> 26#include <linux/interrupt.h>
@@ -304,18 +306,6 @@ out_free_irq:
304 return ret; 306 return ret;
305} 307}
306 308
307static int adp5520_remove(struct i2c_client *client)
308{
309 struct adp5520_chip *chip = dev_get_drvdata(&client->dev);
310
311 if (chip->irq)
312 free_irq(chip->irq, chip);
313
314 adp5520_remove_subdevs(chip);
315 adp5520_write(chip->dev, ADP5520_MODE_STATUS, 0);
316 return 0;
317}
318
319#ifdef CONFIG_PM_SLEEP 309#ifdef CONFIG_PM_SLEEP
320static int adp5520_suspend(struct device *dev) 310static int adp5520_suspend(struct device *dev)
321{ 311{
@@ -346,20 +336,14 @@ static const struct i2c_device_id adp5520_id[] = {
346 { "pmic-adp5501", ID_ADP5501 }, 336 { "pmic-adp5501", ID_ADP5501 },
347 { } 337 { }
348}; 338};
349MODULE_DEVICE_TABLE(i2c, adp5520_id);
350 339
351static struct i2c_driver adp5520_driver = { 340static struct i2c_driver adp5520_driver = {
352 .driver = { 341 .driver = {
353 .name = "adp5520", 342 .name = "adp5520",
354 .pm = &adp5520_pm, 343 .pm = &adp5520_pm,
344 .suppress_bind_attrs = true,
355 }, 345 },
356 .probe = adp5520_probe, 346 .probe = adp5520_probe,
357 .remove = adp5520_remove,
358 .id_table = adp5520_id, 347 .id_table = adp5520_id,
359}; 348};
360 349builtin_i2c_driver(adp5520_driver);
361module_i2c_driver(adp5520_driver);
362
363MODULE_AUTHOR("Michael Hennerich <michael.hennerich@analog.com>");
364MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");
365MODULE_LICENSE("GPL");