Skip to content
Permalink
Browse files
net: ks8851: Fix mixed module/builtin build
When either the SPI or PAR variant is compiled as module AND the other
variant is compiled as built-in, the following build error occurs:

arm-linux-gnueabi-ld: drivers/net/ethernet/micrel/ks8851_common.o: in function `ks8851_probe_common':
ks8851_common.c:(.text+0x1564): undefined reference to `__this_module'

Fix this by including the ks8851_common.c in both ks8851_spi.c and
ks8851_par.c. The DEBUG macro is defined in ks8851_common.c, so it
does not have to be defined again.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>
  • Loading branch information
Marek Vasut authored and intel-lab-lkp committed Jan 15, 2021
1 parent 1d9f03c commit e11965ba009b3247ecbbb87730c724405eae8753
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
@@ -5,7 +5,7 @@

obj-$(CONFIG_KS8842) += ks8842.o
obj-$(CONFIG_KS8851) += ks8851.o
ks8851-objs = ks8851_common.o ks8851_spi.o
ks8851-objs = ks8851_spi.o
obj-$(CONFIG_KS8851_MLL) += ks8851_mll.o
ks8851_mll-objs = ks8851_common.o ks8851_par.o
ks8851_mll-objs = ks8851_par.o
obj-$(CONFIG_KSZ884X_PCI) += ksz884x.o
@@ -8,7 +8,7 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#define DEBUG
#include "ks8851_common.c"

#include <linux/interrupt.h>
#include <linux/module.h>
@@ -8,7 +8,7 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#define DEBUG
#include "ks8851_common.c"

#include <linux/interrupt.h>
#include <linux/module.h>

0 comments on commit e11965b

Please sign in to comment.