mac80211: add backport of the module_pci_driver macro
[openwrt/staging/chunkeey.git] / package / mac80211 / patches / 301-add-module_pci_driver-to-compat-3.4.patch
1 --- a/include/linux/compat-3.4.h
2 +++ b/include/linux/compat-3.4.h
3 @@ -62,6 +62,18 @@ static inline void eth_hw_addr_random(st
4 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
5 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)) */
6
7 +/**
8 + * module_pci_driver() - Helper macro for registering a PCI driver
9 + * @__pci_driver: pci_driver struct
10 + *
11 + * Helper macro for PCI drivers which do not do anything special in module
12 + * init/exit. This eliminates a lot of boilerplate. Each module may only
13 + * use this macro once, and calling it replaces module_init() and module_exit()
14 + */
15 +#define module_pci_driver(__pci_driver) \
16 + module_driver(__pci_driver, pci_register_driver, \
17 + pci_unregister_driver)
18 +
19 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
20
21 #endif /* LINUX_5_4_COMPAT_H */