Commit af5db808a41f1d63ecc835024d6d3b169600f36d

Authored by Paul Gortmaker
Committed by Lee Jones
1 parent e85c5f0a1b

mfd: wm831x-i2c: Make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/mfd/Kconfig:config MFD_WM831X_I2C
drivers/mfd/Kconfig:    bool "Wolfson Microelectronics WM831x/2x PMICs with I2C"

...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.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

Showing 1 changed file with 2 additions and 18 deletions Side-by-side Diff

drivers/mfd/wm831x-i2c.c
... ... @@ -13,7 +13,7 @@
13 13 */
14 14  
15 15 #include <linux/kernel.h>
16   -#include <linux/module.h>
  16 +#include <linux/init.h>
17 17 #include <linux/i2c.h>
18 18 #include <linux/delay.h>
19 19 #include <linux/mfd/core.h>
... ... @@ -68,15 +68,6 @@
68 68 return wm831x_device_init(wm831x, i2c->irq);
69 69 }
70 70  
71   -static int wm831x_i2c_remove(struct i2c_client *i2c)
72   -{
73   - struct wm831x *wm831x = i2c_get_clientdata(i2c);
74   -
75   - wm831x_device_exit(wm831x);
76   -
77   - return 0;
78   -}
79   -
80 71 static int wm831x_i2c_suspend(struct device *dev)
81 72 {
82 73 struct wm831x *wm831x = dev_get_drvdata(dev);
... ... @@ -103,7 +94,6 @@
103 94 { "wm8326", WM8326 },
104 95 { }
105 96 };
106   -MODULE_DEVICE_TABLE(i2c, wm831x_i2c_id);
107 97  
108 98 static const struct dev_pm_ops wm831x_pm_ops = {
109 99 .suspend = wm831x_i2c_suspend,
110 100  
... ... @@ -115,9 +105,9 @@
115 105 .name = "wm831x",
116 106 .pm = &wm831x_pm_ops,
117 107 .of_match_table = of_match_ptr(wm831x_of_match),
  108 + .suppress_bind_attrs = true,
118 109 },
119 110 .probe = wm831x_i2c_probe,
120   - .remove = wm831x_i2c_remove,
121 111 .id_table = wm831x_i2c_id,
122 112 };
123 113  
... ... @@ -132,10 +122,4 @@
132 122 return ret;
133 123 }
134 124 subsys_initcall(wm831x_i2c_init);
135   -
136   -static void __exit wm831x_i2c_exit(void)
137   -{
138   - i2c_del_driver(&wm831x_i2c_driver);
139   -}
140   -module_exit(wm831x_i2c_exit);