iwlegacy: debugfs_ops should depend on CONFIG_IWLEGACY_DEBUGFS
authorGreg Dietsche <Gregory.Dietsche@cuw.edu>
Wed, 7 Sep 2011 00:11:35 +0000 (19:11 -0500)
committerStanislaw Gruszka <sgruszka@redhat.com>
Wed, 16 Nov 2011 11:55:12 +0000 (12:55 +0100)
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>
drivers/net/wireless/iwlegacy/3945.c
drivers/net/wireless/iwlegacy/3945.h
drivers/net/wireless/iwlegacy/4965.c
drivers/net/wireless/iwlegacy/4965.h
drivers/net/wireless/iwlegacy/common.h

index 7367dbb75ec684a49a63d0018e7edf0ad637652c..863664f9ba8bbbb4fdf166726e81075a326e324b 100644 (file)
@@ -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 = {
index 00d3336fd16b2605177aee49dda6be32ee287d4f..2b2895c544d711b1430f4f39754b01eae2d6b397 100644 (file)
@@ -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
index ac80a0069124757eddccf576b93c55f288a70da5..84c54dccf195668b0c8331010cb3d229188877c2 100644 (file)
@@ -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 = {
index ded8b922a44e987851b91c888f2bf5f91dd76909..74472314bc37dfc49241857db8e8911acbd66219 100644 (file)
@@ -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
 
 /****************************/
index d0975ab8b90811365ca93d469a1b92017a441bf8..1bc0b02f559c8390f27efc6a336f0fb6a21b468b 100644 (file)
@@ -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);
@@ -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);
@@ -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
 
 };