SMSC LAN911x/LAN921x embedded ethernet support can't be loaded dynamically as module

If you select SMSC LAN911x/LAN921x support in kernel (CONFIG_SMSC911X) to be dynamically loaded as module, it will fail during runtime with:
# modprobe smsc911x
smsc911x: relocation out of range, section 2 reloc 0 sym 'spi_cpld_read'
modprobe: can't load module smsc911x (kernel/drivers/net/smsc911x.ko): invalid module format

store text below in a file e.g. smsc911x.patch, on your development host do:
# cd /usr/local/DigiEL-5.8/kernel/linux-2.6.35
# patch -p1 <smsc911x.patch

recompile and reinstall your project. Next time you load the module, you will see:
# modprobe smsc911x
# lsmod
Module       Size ...
smsc911x   ..

This is the patch:
From 7534d0292b83d18067d3940db4254884d2771e4a Mon Sep 17 00:00:00 2001
Date: Thu, 19 Jul 2012 16:26:28 +0200
Subject: [PATCH] mxc: smsc911x, remove unlinkable symbols.
This fixes Vantive 44419.
drivers/net/smsc911x.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/+#ifdef CONFIG_ARCH_MX25
if (pdata->config.flags & 0x8000) {
unsigned long flags;
spin_lock_irqsave(&pdata->dev_lock, flags);
Last updated: Jun 04, 2019

Recently Viewed Articles

No recently viewed articles