diff options
author | Vladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com> | 2015-06-09 14:11:19 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-06-09 14:39:12 +0300 |
commit | b39d69377e4b331f42de1b7a103bf7b2205e70ae (patch) | |
tree | f049594b57b75b21b15155e09035ac65b1e53cfc /drivers/net/wireless | |
parent | 8e52fe3088138dcc1cbb718fb65a6a96cdd65249 (diff) | |
download | op-kernel-dev-b39d69377e4b331f42de1b7a103bf7b2205e70ae.zip op-kernel-dev-b39d69377e4b331f42de1b7a103bf7b2205e70ae.tar.gz |
wil6210: platform hooks for modile init/exit
Provide platform hooks for module init/exit.
If platform require to perform some specific actions
in global context, this is where to do so.
Example may be turning on power for the PCIE based
on DT information.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/pcie_bus.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil_platform.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil_platform.h | 3 |
3 files changed, 33 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c index 58c7916..a4417d4 100644 --- a/drivers/net/wireless/ath/wil6210/pcie_bus.c +++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c @@ -291,7 +291,27 @@ static struct pci_driver wil6210_driver = { .name = WIL_NAME, }; -module_pci_driver(wil6210_driver); +static int __init wil6210_driver_init(void) +{ + int rc; + + rc = wil_platform_modinit(); + if (rc) + return rc; + + rc = pci_register_driver(&wil6210_driver); + if (rc) + wil_platform_modexit(); + return rc; +} +module_init(wil6210_driver_init); + +static void __exit wil6210_driver_exit(void) +{ + pci_unregister_driver(&wil6210_driver); + wil_platform_modexit(); +} +module_exit(wil6210_driver_exit); MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Qualcomm Atheros <wil6210@qca.qualcomm.com>"); diff --git a/drivers/net/wireless/ath/wil6210/wil_platform.c b/drivers/net/wireless/ath/wil6210/wil_platform.c index 976a071..1db680f 100644 --- a/drivers/net/wireless/ath/wil6210/wil_platform.c +++ b/drivers/net/wireless/ath/wil6210/wil_platform.c @@ -17,6 +17,15 @@ #include "linux/device.h" #include "wil_platform.h" +int __init wil_platform_modinit(void) +{ + return 0; +} + +void wil_platform_modexit(void) +{ +} + /** * wil_platform_init() - wil6210 platform module init * diff --git a/drivers/net/wireless/ath/wil6210/wil_platform.h b/drivers/net/wireless/ath/wil6210/wil_platform.h index 158c73b..d7fa19b 100644 --- a/drivers/net/wireless/ath/wil6210/wil_platform.h +++ b/drivers/net/wireless/ath/wil6210/wil_platform.h @@ -31,4 +31,7 @@ struct wil_platform_ops { void *wil_platform_init(struct device *dev, struct wil_platform_ops *ops); +int __init wil_platform_modinit(void); +void wil_platform_modexit(void); + #endif /* __WIL_PLATFORM_H__ */ |