Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48e29340 authored by Johannes Berg's avatar Johannes Berg
Browse files

iwlwifi: export symbols only conditionally



If all the pieces of iwlwifi are built into the kernel
then there's no need for it to export its symbols to
other modules, so prevent that.

Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1218206e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ config IWLMVM

	  Say yes if you have such a device.

# don't call it _MODULE -- will confuse Kconfig/fixdep/...
config IWLWIFI_OPMODE_MODULAR
	bool
	default y if IWLDVM=m
	default y if IWLMVM=m

comment "WARNING: iwlwifi is useless without IWLDVM or IWLMVM"
	depends on IWLWIFI && IWLDVM=n && IWLMVM=n

+6 −5
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/export.h>
#include "iwl-drv.h"
#include "iwl-debug.h"
#include "iwl-devtrace.h"

@@ -85,11 +86,11 @@ void __iwl_ ##fn(struct device *dev, const char *fmt, ...) \
}

__iwl_fn(warn)
EXPORT_SYMBOL_GPL(__iwl_warn);
IWL_EXPORT_SYMBOL(__iwl_warn);
__iwl_fn(info)
EXPORT_SYMBOL_GPL(__iwl_info);
IWL_EXPORT_SYMBOL(__iwl_info);
__iwl_fn(crit)
EXPORT_SYMBOL_GPL(__iwl_crit);
IWL_EXPORT_SYMBOL(__iwl_crit);

void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only,
		const char *fmt, ...)
@@ -110,7 +111,7 @@ void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only,
	trace_iwlwifi_err(&vaf);
	va_end(args);
}
EXPORT_SYMBOL_GPL(__iwl_err);
IWL_EXPORT_SYMBOL(__iwl_err);

#if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING)
void __iwl_dbg(struct device *dev,
@@ -133,5 +134,5 @@ void __iwl_dbg(struct device *dev,
	trace_iwlwifi_dbg(level, in_interrupt(), function, &vaf);
	va_end(args);
}
EXPORT_SYMBOL_GPL(__iwl_dbg);
IWL_EXPORT_SYMBOL(__iwl_dbg);
#endif
+3 −3
Original line number Diff line number Diff line
@@ -1111,7 +1111,7 @@ struct iwl_mod_params iwlwifi_mod_params = {
	.wd_disable = true,
	/* the rest are 0 by default */
};
EXPORT_SYMBOL_GPL(iwlwifi_mod_params);
IWL_EXPORT_SYMBOL(iwlwifi_mod_params);

int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
{
@@ -1135,7 +1135,7 @@ int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
	mutex_unlock(&iwlwifi_opmode_table_mtx);
	return -EIO;
}
EXPORT_SYMBOL_GPL(iwl_opmode_register);
IWL_EXPORT_SYMBOL(iwl_opmode_register);

void iwl_opmode_deregister(const char *name)
{
@@ -1157,7 +1157,7 @@ void iwl_opmode_deregister(const char *name)
	}
	mutex_unlock(&iwlwifi_opmode_table_mtx);
}
EXPORT_SYMBOL_GPL(iwl_opmode_deregister);
IWL_EXPORT_SYMBOL(iwl_opmode_deregister);

static int __init iwl_drv_init(void)
{
+15 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@
#ifndef __iwl_drv_h__
#define __iwl_drv_h__

#include <linux/module.h>

/* for all modules */
#define DRV_NAME        "iwlwifi"
#define IWLWIFI_VERSION "in-tree:"
@@ -123,4 +125,17 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans,
 */
void iwl_drv_stop(struct iwl_drv *drv);

/*
 * exported symbol management
 *
 * The driver can be split into multiple modules, in which case some symbols
 * must be exported for the sub-modules. However, if it's not split and
 * everything is built-in, then we can avoid that.
 */
#ifdef CONFIG_IWLWIFI_OPMODE_MODULAR
#define IWL_EXPORT_SYMBOL(sym)	EXPORT_SYMBOL_GPL(sym)
#else
#define IWL_EXPORT_SYMBOL(sym)
#endif

#endif /* __iwl_drv_h__ */
+3 −2
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/export.h>
#include "iwl-drv.h"
#include "iwl-modparams.h"
#include "iwl-eeprom-parse.h"

@@ -909,7 +910,7 @@ iwl_parse_eeprom_data(struct device *dev, const struct iwl_cfg *cfg,
	kfree(data);
	return NULL;
}
EXPORT_SYMBOL_GPL(iwl_parse_eeprom_data);
IWL_EXPORT_SYMBOL(iwl_parse_eeprom_data);

/* helper functions */
int iwl_nvm_check_version(struct iwl_nvm_data *data,
@@ -928,4 +929,4 @@ int iwl_nvm_check_version(struct iwl_nvm_data *data,
		data->calib_version,  trans->cfg->nvm_calib_ver);
	return -EINVAL;
}
EXPORT_SYMBOL_GPL(iwl_nvm_check_version);
IWL_EXPORT_SYMBOL(iwl_nvm_check_version);
Loading