diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-10-31 13:59:47 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2016-11-17 19:44:38 -0500 |
commit | ff3a98be794d13dc0104c0a1fbab2b52f1a3299b (patch) | |
tree | c1aefd0926699bd3f51014c4be454a09c8a4f026 /drivers/i2c/busses/i2c-pxa-pci.c | |
parent | c02b7bf532f7e46f1f9a0e9c3c27ca3f6f134e8d (diff) |
i2c: i2c-pxa-pci; make explicitly non-modular
The Kconfig currently controlling compilation of this code is:
drivers/i2c/busses/Kconfig:config I2C_PXA_PCI
drivers/i2c/busses/Kconfig: def_bool I2C_PXA && X86_32 && PCI && OF
...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_pci_driver() uses the same init level priority as
builtin_pci_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: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa-pci.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa-pci.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index 417464e9ea2a..004deb96afe3 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c | |||
@@ -1,9 +1,13 @@ | |||
1 | /* | 1 | /* |
2 | * CE4100 PCI-I2C glue code for PXA's driver | ||
3 | * Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> | ||
4 | * License: GPL v2 | ||
5 | * | ||
2 | * The CE4100's I2C device is more or less the same one as found on PXA. | 6 | * The CE4100's I2C device is more or less the same one as found on PXA. |
3 | * It does not support slave mode, the register slightly moved. This PCI | 7 | * It does not support slave mode, the register slightly moved. This PCI |
4 | * device provides three bars, every contains a single I2C controller. | 8 | * device provides three bars, every contains a single I2C controller. |
5 | */ | 9 | */ |
6 | #include <linux/module.h> | 10 | #include <linux/init.h> |
7 | #include <linux/pci.h> | 11 | #include <linux/pci.h> |
8 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
9 | #include <linux/i2c/pxa-i2c.h> | 13 | #include <linux/i2c/pxa-i2c.h> |
@@ -134,35 +138,17 @@ err_mem: | |||
134 | return ret; | 138 | return ret; |
135 | } | 139 | } |
136 | 140 | ||
137 | static void ce4100_i2c_remove(struct pci_dev *dev) | ||
138 | { | ||
139 | struct ce4100_devices *sds; | ||
140 | unsigned int i; | ||
141 | |||
142 | sds = pci_get_drvdata(dev); | ||
143 | |||
144 | for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) | ||
145 | platform_device_unregister(sds->pdev[i]); | ||
146 | |||
147 | pci_disable_device(dev); | ||
148 | kfree(sds); | ||
149 | } | ||
150 | |||
151 | static const struct pci_device_id ce4100_i2c_devices[] = { | 141 | static const struct pci_device_id ce4100_i2c_devices[] = { |
152 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)}, | 142 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)}, |
153 | { }, | 143 | { }, |
154 | }; | 144 | }; |
155 | MODULE_DEVICE_TABLE(pci, ce4100_i2c_devices); | ||
156 | 145 | ||
157 | static struct pci_driver ce4100_i2c_driver = { | 146 | static struct pci_driver ce4100_i2c_driver = { |
147 | .driver = { | ||
148 | .suppress_bind_attrs = true, | ||
149 | }, | ||
158 | .name = "ce4100_i2c", | 150 | .name = "ce4100_i2c", |
159 | .id_table = ce4100_i2c_devices, | 151 | .id_table = ce4100_i2c_devices, |
160 | .probe = ce4100_i2c_probe, | 152 | .probe = ce4100_i2c_probe, |
161 | .remove = ce4100_i2c_remove, | ||
162 | }; | 153 | }; |
163 | 154 | builtin_pci_driver(ce4100_i2c_driver); | |
164 | module_pci_driver(ce4100_i2c_driver); | ||
165 | |||
166 | MODULE_DESCRIPTION("CE4100 PCI-I2C glue code for PXA's driver"); | ||
167 | MODULE_LICENSE("GPL v2"); | ||
168 | MODULE_AUTHOR("Sebastian Andrzej Siewior <bigeasy@linutronix.de>"); | ||