Skip to contentSkip to conversation

rtw88: fix multiple definition of rtw_pm_ops

PATCH In review Ping-Ke Shih 2 participants 2 messages Dec 8, 2020 Realtek wireless driver (rtw88)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 rtw88: fix multiple definition of rtw_pm_ops

'const struct dev_pm_ops rtw_pm_ops' is declared by pci.c, and it should be declare as 'extern' in pci.h. Without 'extern' causes every file including pci.h has an individual instance of rtw_pm_ops but not reference to the one declared in pci.c

If kernel config, like test robot, doesn't build driver as module, it leads multiple definition.

Fixes 2e86ef413ab3 ("rtw88: pci: Add prototypes for .probe, .remove and .shutdown")
---
 drivers/net/wireless/realtek/rtw88/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw88/pci.h +1 -1
index cda56919a5f0..7cdefe229824 100644
@@ -214,7 +214,7 @@ struct rtw_pci {
 	void __iomem *mmap;
 };
 
-const struct dev_pm_ops rtw_pm_ops;
+extern const struct dev_pm_ops rtw_pm_ops;
 
 int rtw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id);
 void rtw_pci_remove(struct pci_dev *pdev);
Signature · 1 line
2.21.0
#1 lore raw
Quoted 11 lines · Ping-Ke Shih

'const struct dev_pm_ops rtw_pm_ops' is declared by pci.c, and it should be declare as 'extern' in pci.h. Without 'extern' causes every file including pci.h has an individual instance of rtw_pm_ops but not reference to the one declared in pci.c

If kernel config, like test robot, doesn't build driver as module, it leads multiple definition.

Fixes 2e86ef413ab3 ("rtw88: pci: Add prototypes for .probe, .remove and .shutdown")

Patch applied to wireless-drivers-next.git, thanks.

91aeaf09a6ee rtw88: fix multiple definition of rtw_pm_ops

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches