Skip to contentSkip to conversation

staging: rtl8192u: r8192U_core: Fix compile issue when CONFIG_WIRELESS_EXT is not defined

PATCH In review Murilo Opsfelder Araujo 2 participants 2 messages Jan 24, 2015 – Jan 25, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8192u: r8192U_core: Fix compile issue when CONFIG_WIRELESS_EXT is not defined

This patch gets rid of the following error when compiling r8192U_core.c and CONFIG_WIRELESS_EXT is not defined:

drivers/staging/rtl8192u/r8192U_core.c: In function ‘rtl8192_usb_probe’:
drivers/staging/rtl8192u/r8192U_core.c:4697:5: error: ‘struct net_device’ has no member named ‘wireless_handlers’

  dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
     ^
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/rtl8192u/r8192U_core.c +2 -0
index e031a25..396a11f 100644
@@ -4694,7 +4694,9 @@ static int rtl8192_usb_probe(struct usb_interface *intf,
 
 	dev->netdev_ops = &rtl8192_netdev_ops;
 
+#ifdef CONFIG_WIRELESS_EXT
 	dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
+#endif
 
 	dev->type = ARPHRD_ETHER;
 
Signature · 1 line
2.1.0
maintainer
#1 lore raw
Quoted 18 lines · Murilo Opsfelder Araujo

This patch gets rid of the following error when compiling r8192U_core.c and CONFIG_WIRELESS_EXT is not defined:

drivers/staging/rtl8192u/r8192U_core.c: In function ‘rtl8192_usb_probe’:
drivers/staging/rtl8192u/r8192U_core.c:4697:5: error: ‘struct net_device’ has no member named ‘wireless_handlers’

  dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
     ^
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index e031a25..396a11f 100644

drivers/staging/rtl8192u/r8192U_core.c static int rtl8192_usb_probe(struct usb_interface *intf, · line 4699

Quoted 6 lines
drivers/staging/rtl8192u/r8192U_core.c +2 -0
@@ -4694,7 +4694,9 @@ static int rtl8192_usb_probe(struct usb_interface *intf,
 
 	dev->netdev_ops = &rtl8192_netdev_ops;
 
+#ifdef CONFIG_WIRELESS_EXT
 	dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
+#endif

It's almost never correct to put a #ifdef in a .c file, so what is going on here? How do other drivers handle this in a more "proper" way?

Is this something new? Should this driver just depend on this Kconfig option?

I can't take this as-is, sorry.

greg k-h