Skip to content

Commit

Permalink
iwlegacy: debugfs_ops should depend on CONFIG_IWLEGACY_DEBUGFS
Browse files Browse the repository at this point in the history
Only setup structs related to debugfs_ops when CONFIG_IWLEGACY_DEBUGFS is set.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
  • Loading branch information
Greg Dietsche authored and Stanislaw Gruszka committed Nov 16, 2011
1 parent e3a2c77 commit 9b5e2f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 42 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlegacy/3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -2671,11 +2671,13 @@ static struct il_lib_ops il3945_lib = {
.send_tx_power = il3945_send_tx_power,
.is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,

#ifdef CONFIG_IWLEGACY_DEBUGFS
.debugfs_ops = {
.rx_stats_read = il3945_ucode_rx_stats_read,
.tx_stats_read = il3945_ucode_tx_stats_read,
.general_stats_read = il3945_ucode_general_stats_read,
},
#endif
};

static const struct il_legacy_ops il3945_legacy_ops = {
Expand Down
21 changes: 0 additions & 21 deletions drivers/net/wireless/iwlegacy/3945.h
Original file line number Diff line number Diff line change
Expand Up @@ -621,27 +621,6 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file, char __user *user_buf,
ssize_t il3945_ucode_general_stats_read(struct file *file,
char __user *user_buf, size_t count,
loff_t *ppos);
#else
static ssize_t
il3945_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}

static ssize_t
il3945_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}

static ssize_t
il3945_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}
#endif

#endif
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlegacy/4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -2333,11 +2333,13 @@ static struct il_lib_ops il4965_lib = {
.temp_ops = {
.temperature = il4965_temperature_calib,
},
#ifdef CONFIG_IWLEGACY_DEBUGFS
.debugfs_ops = {
.rx_stats_read = il4965_ucode_rx_stats_read,
.tx_stats_read = il4965_ucode_tx_stats_read,
.general_stats_read = il4965_ucode_general_stats_read,
},
#endif
};

static const struct il_legacy_ops il4965_legacy_ops = {
Expand Down
21 changes: 0 additions & 21 deletions drivers/net/wireless/iwlegacy/4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -956,27 +956,6 @@ ssize_t il4965_ucode_tx_stats_read(struct file *file, char __user *user_buf,
ssize_t il4965_ucode_general_stats_read(struct file *file,
char __user *user_buf, size_t count,
loff_t *ppos);
#else
static ssize_t
il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}

static ssize_t
il4965_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}

static ssize_t
il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
return 0;
}
#endif

/****************************/
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/iwlegacy/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1631,6 +1631,7 @@ struct il_apm_ops {
void (*config) (struct il_priv *il);
};

#ifdef CONFIG_IWLEGACY_DEBUGFS
struct il_debugfs_ops {
ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf,
size_t count, loff_t *ppos);
Expand All @@ -1640,6 +1641,7 @@ struct il_debugfs_ops {
char __user *user_buf, size_t count,
loff_t *ppos);
};
#endif

struct il_temp_ops {
void (*temperature) (struct il_priv *il);
Expand Down Expand Up @@ -1683,7 +1685,9 @@ struct il_lib_ops {
/* temperature */
struct il_temp_ops temp_ops;

#ifdef CONFIG_IWLEGACY_DEBUGFS
struct il_debugfs_ops debugfs_ops;
#endif

};

Expand Down

0 comments on commit 9b5e2f4

Please sign in to comment.