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

mfd: max77843: Make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_MAX77843
drivers/mfd/Kconfig: bool "Maxim Semiconductor MAX77843 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_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.

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
38f70da3 047cfd01

+2 -22
+2 -22
drivers/mfd/max77843.c
··· 15 15 #include <linux/i2c.h> 16 16 #include <linux/init.h> 17 17 #include <linux/interrupt.h> 18 - #include <linux/module.h> 18 + #include <linux/init.h> 19 19 #include <linux/mfd/core.h> 20 20 #include <linux/mfd/max77693-common.h> 21 21 #include <linux/mfd/max77843-private.h> ··· 171 171 return ret; 172 172 } 173 173 174 - static int max77843_remove(struct i2c_client *i2c) 175 - { 176 - struct max77693_dev *max77843 = i2c_get_clientdata(i2c); 177 - 178 - mfd_remove_devices(max77843->dev); 179 - 180 - regmap_del_irq_chip(max77843->irq, max77843->irq_data_topsys); 181 - 182 - i2c_unregister_device(max77843->i2c_chg); 183 - 184 - return 0; 185 - } 186 - 187 174 static const struct of_device_id max77843_dt_match[] = { 188 175 { .compatible = "maxim,max77843", }, 189 176 { }, ··· 180 193 { "max77843", TYPE_MAX77843, }, 181 194 { }, 182 195 }; 183 - MODULE_DEVICE_TABLE(i2c, max77843_id); 184 196 185 197 static int __maybe_unused max77843_suspend(struct device *dev) 186 198 { ··· 212 226 .name = "max77843", 213 227 .pm = &max77843_pm, 214 228 .of_match_table = max77843_dt_match, 229 + .suppress_bind_attrs = true, 215 230 }, 216 231 .probe = max77843_probe, 217 - .remove = max77843_remove, 218 232 .id_table = max77843_id, 219 233 }; 220 234 ··· 223 237 return i2c_add_driver(&max77843_i2c_driver); 224 238 } 225 239 subsys_initcall(max77843_i2c_init); 226 - 227 - static void __exit max77843_i2c_exit(void) 228 - { 229 - i2c_del_driver(&max77843_i2c_driver); 230 - } 231 - module_exit(max77843_i2c_exit);