diff mbox

[4/6] ath9k: Only spectral scan relay file when it was created

Message ID 1359624409-14815-4-git-send-email-sven@narfation.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Sven Eckelmann Jan. 31, 2013, 9:26 a.m. UTC
The relay file depends on relayfs. Trying to close this file without having
ATH9K_DEBUGFS (and therefore RELAY) activated causes build failures.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 drivers/net/wireless/ath/ath9k/init.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Kalle Valo Jan. 31, 2013, 1:57 p.m. UTC | #1
Sven Eckelmann <sven@narfation.org> writes:

> The relay file depends on relayfs. Trying to close this file without having
> ATH9K_DEBUGFS (and therefore RELAY) activated causes build failures.
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>

[...]

> +#ifdef CONFIG_ATH9K_DEBUGFS
>  	if (sc->rfs_chan_spec_scan) {
>  		relay_close(sc->rfs_chan_spec_scan);
>  		sc->rfs_chan_spec_scan = NULL;
>  	}
> +#endif

Instead of ugly #ifdef you could do something like this:

        if (config_enabled(CONFIG_ATH6KL_REGDOMAIN) &&

I think you could use that elsehwere in your patchset as well, but I
didn't check that carefully.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index c7d116c..93a6dba 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -922,10 +922,12 @@  static void ath9k_deinit_softc(struct ath_softc *sc)
 
 	ath9k_eeprom_release(sc);
 
+#ifdef CONFIG_ATH9K_DEBUGFS
 	if (sc->rfs_chan_spec_scan) {
 		relay_close(sc->rfs_chan_spec_scan);
 		sc->rfs_chan_spec_scan = NULL;
 	}
+#endif
 }
 
 void ath9k_deinit_device(struct ath_softc *sc)