Skip to content

Commit a458cce

Browse files
Adham Abozaeidclaudiubeznea
authored andcommitted
staging: wilc1000: Compilation errors if compilation switches are disabled
Compilation and linking erros are observed if compilation switches DISABLE_PWRSAVE_AND_SCAN_DURING_IP and WILC_DEBUGFS aren't defiend Fixes analogdevicesinc#41 Signed-off-by: Adham Abozaeid <[email protected]>
1 parent 228aad6 commit a458cce

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

drivers/staging/wilc1000/host_interface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2589,8 +2589,10 @@ int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout)
25892589
wilc_get_vif_idx(vif));
25902590
if (result)
25912591
PRINT_ER(vif->ndev, "Failed to send power management\n");
2592+
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
25922593
else
25932594
store_power_save_current_state(vif, power_mode);
2595+
#endif
25942596

25952597
return result;
25962598
}
@@ -2619,6 +2621,7 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count,
26192621
return result;
26202622
}
26212623

2624+
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
26222625
void handle_powersave_state_changes(struct work_struct *work)
26232626
{
26242627
struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
@@ -2646,6 +2649,7 @@ void wilc_powersave_state_changes(struct wilc_vif *vif)
26462649
kfree(msg);
26472650
}
26482651
}
2652+
#endif
26492653

26502654
int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power)
26512655
{

drivers/staging/wilc1000/wilc_debugfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* All rights reserved.
55
*/
66

7-
#if defined(WILC_DEBUGFS)
87
#include <linux/module.h>
98
#include <linux/debugfs.h>
109

1110
#include "wilc_debugfs.h"
1211

13-
static struct dentry *wilc_dir;
14-
1512
atomic_t WILC_DEBUG_REGION = ATOMIC_INIT(INIT_DBG);
1613

14+
#if defined(WILC_DEBUGFS)
15+
static struct dentry *wilc_dir;
16+
1717
static ssize_t wilc_debug_region_read(struct file *file, char __user *userbuf,
1818
size_t count, loff_t *ppos)
1919
{

drivers/staging/wilc1000/wilc_netdev.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
#include "wilc_netdev.h"
2121
#include "wilc_wfi_cfgoperations.h"
2222

23+
#define WILC_MULTICAST_TABLE_SIZE 8
24+
2325
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
2426
bool g_ignore_PS_state;
2527
#define WILC_IP_TIMEOUT_MS 15000
2628

27-
#define WILC_MULTICAST_TABLE_SIZE 8
28-
2929
void handle_pwrsave_for_IP(struct wilc_vif *vif, uint8_t state)
3030
{
3131
struct wilc_priv *priv;
@@ -1557,7 +1557,9 @@ void wilc_netdev_cleanup(struct wilc *wilc)
15571557
destroy_workqueue(wilc->hif_workqueue);
15581558
wilc->hif_workqueue = NULL;
15591559
cfg_deinit(wilc);
1560+
#ifdef WILC_DEBUGFS
15601561
wilc_debugfs_remove();
1562+
#endif
15611563
wilc_sysfs_exit();
15621564
wlan_deinit_locks(wilc);
15631565
kfree(wilc->bus_data);
@@ -1586,10 +1588,12 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
15861588
if (ret)
15871589
goto free_locks;
15881590

1591+
#ifdef WILC_DEBUGFS
15891592
if (wilc_debugfs_init()) {
15901593
ret = -ENOMEM;
15911594
goto free_cfg;
15921595
}
1596+
#endif
15931597
wl->io_type = io_type;
15941598
wl->hif_func = ops;
15951599

@@ -1673,12 +1677,16 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
16731677
}
16741678
}
16751679
}
1680+
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
16761681
unregister_inetaddr_notifier(&g_dev_notifier);
1682+
#endif
16771683
destroy_workqueue(wl->hif_workqueue);
16781684

16791685
free_debug_fs:
1686+
#ifdef WILC_DEBUGFS
16801687
wilc_debugfs_remove();
16811688
free_cfg:
1689+
#endif
16821690
cfg_deinit(wl);
16831691
free_locks:
16841692
wlan_deinit_locks(wl);

drivers/staging/wilc1000/wilc_netdev.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020

2121
extern int wait_for_recovery;
2222

23+
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
2324
void handle_pwrsave_for_IP(struct wilc_vif *vif, uint8_t state);
2425
void store_power_save_current_state(struct wilc_vif *vif, bool val);
2526
#if KERNEL_VERSION(4, 15, 0) <= LINUX_VERSION_CODE
2627
void clear_during_ip(struct timer_list *t);
2728
#else
2829
void clear_during_ip(unsigned long arg);
2930
#endif
30-
31+
#endif //DISABLE_PWRSAVE_AND_SCAN_DURING_IP
3132
struct net_device *wilc_get_if_netdev(struct wilc *wilc, uint8_t ifc);
3233
struct host_if_drv *get_drv_hndl_by_ifc(struct wilc *wilc, uint8_t ifc);
3334

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
16611661
return -EIO;
16621662
}
16631663

1664+
#ifdef DISABLE_PWRSAVE_AND_SCAN_DURING_IP
16641665
/* Can't set PS during obtaining IP */
16651666
if (vif->obtaining_ip == true) {
16661667
PRINT_ER(dev,
@@ -1673,7 +1674,7 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
16731674

16741675
return 0;
16751676
}
1676-
1677+
#endif
16771678
PRINT_INFO(vif->ndev, CFG80211_DBG,
16781679
" Power save Enabled= %d , TimeOut = %d\n", enabled,
16791680
timeout);

0 commit comments

Comments
 (0)