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

mfd: max8997: Make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX8997
drivers/mfd/Kconfig: bool "Maxim Semiconductor MAX8997/8966 PMIC 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_init was not in use by this code, 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
is already contained at the top of the file in the comments.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Paul Gortmaker and committed by
Lee Jones
9cf0c21f b9e38338

+3 -27
+3 -27
drivers/mfd/max8997.c
··· 2 2 * max8997.c - mfd core driver for the Maxim 8966 and 8997 3 3 * 4 4 * Copyright (C) 2011 Samsung Electronics 5 - * MyungJoo Ham <myungjoo.ham@smasung.com> 5 + * MyungJoo Ham <myungjoo.ham@samsung.com> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify 8 8 * it under the terms of the GNU General Public License as published by ··· 28 28 #include <linux/of_irq.h> 29 29 #include <linux/interrupt.h> 30 30 #include <linux/pm_runtime.h> 31 - #include <linux/module.h> 31 + #include <linux/init.h> 32 32 #include <linux/mutex.h> 33 33 #include <linux/mfd/core.h> 34 34 #include <linux/mfd/max8997.h> ··· 55 55 { .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 }, 56 56 {}, 57 57 }; 58 - MODULE_DEVICE_TABLE(of, max8997_pmic_dt_match); 59 58 #endif 60 59 61 60 int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) ··· 262 263 return ret; 263 264 } 264 265 265 - static int max8997_i2c_remove(struct i2c_client *i2c) 266 - { 267 - struct max8997_dev *max8997 = i2c_get_clientdata(i2c); 268 - 269 - mfd_remove_devices(max8997->dev); 270 - i2c_unregister_device(max8997->muic); 271 - i2c_unregister_device(max8997->haptic); 272 - i2c_unregister_device(max8997->rtc); 273 - 274 - return 0; 275 - } 276 - 277 266 static const struct i2c_device_id max8997_i2c_id[] = { 278 267 { "max8997", TYPE_MAX8997 }, 279 268 { "max8966", TYPE_MAX8966 }, 280 269 { } 281 270 }; 282 - MODULE_DEVICE_TABLE(i2c, max8998_i2c_id); 283 271 284 272 static u8 max8997_dumpaddr_pmic[] = { 285 273 MAX8997_REG_INT1MSK, ··· 496 510 .driver = { 497 511 .name = "max8997", 498 512 .pm = &max8997_pm, 513 + .suppress_bind_attrs = true, 499 514 .of_match_table = of_match_ptr(max8997_pmic_dt_match), 500 515 }, 501 516 .probe = max8997_i2c_probe, 502 - .remove = max8997_i2c_remove, 503 517 .id_table = max8997_i2c_id, 504 518 }; 505 519 ··· 509 523 } 510 524 /* init early so consumer devices can complete system boot */ 511 525 subsys_initcall(max8997_i2c_init); 512 - 513 - static void __exit max8997_i2c_exit(void) 514 - { 515 - i2c_del_driver(&max8997_i2c_driver); 516 - } 517 - module_exit(max8997_i2c_exit); 518 - 519 - MODULE_DESCRIPTION("MAXIM 8997 multi-function core driver"); 520 - MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>"); 521 - MODULE_LICENSE("GPL");