Skip to contentSkip to conversation

net: m68k: Allow modular build

PATCH In review Geert Uytterhoeven 2 participants 11 messages Sep 29, 2015 – Sep 30, 2015

Subsystems (5)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover net: m68k: Allow modular build

Hi David, Paul,

This patch series makes the remaining m68k Ethernet drivers modular. It's an alternative to the last 3 patches of Paul Gortmaker's series "[PATCH net-next 0/6] make non-modular code explicitly non-modular".

Note that "[PATCH 5/5] net: macmace: Allow modular build" depends on "[PATCH 4/5] m68k/mac: Export Peripheral System Controller (PSC) base address to modules". Feel free to take the dependency through the netdev tree to avoid modular build breakage.

This was compile-tested only (mac_defconfig + allmodconfig) due to lack of hardware.

Thanks!

Geert Uytterhoeven (5):
net: mac8390: Allow modular build
net: 7990: Export lance_poll() to modules
net: hplance: Allow modular build
m68k/mac: Export Peripheral System Controller (PSC) base address to
modules
net: macmace: Allow modular build

 arch/m68k/mac/psc.c                 |  1 +
 drivers/net/ethernet/8390/Kconfig   |  2 +-
 drivers/net/ethernet/8390/mac8390.c | 32 ++++++++++----------------------
 drivers/net/ethernet/amd/7990.c     |  1 +
 drivers/net/ethernet/amd/Kconfig    |  2 +-
 drivers/net/ethernet/apple/Kconfig  |  2 +-
 6 files changed, 15 insertions(+), 25 deletions(-)
Signature · 12 lines
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH 1/5 net: mac8390: Allow modular build

The modular driver supports only one card, just like the built-in driver.

Note that this limitation is a problem which affects all Nubus card drivers, because they have to do all their own bus matching, because Nubus still lacks the necessary driver model support.

---
 drivers/net/ethernet/8390/Kconfig   |  2 +-
 drivers/net/ethernet/8390/mac8390.c | 32 ++++++++++----------------------
 2 files changed, 11 insertions(+), 23 deletions(-)
drivers/net/ethernet/8390/Kconfig +1 -1
index edf72258ab1ddabe..29c3075bfb052f1d 100644
@@ -64,7 +64,7 @@ config ARM_ETHERH
 	  should say Y to this option if you wish to use it with Linux.
 
 config MAC8390
-	bool "Macintosh NS 8390 based ethernet cards"
+	tristate "Macintosh NS 8390 based ethernet cards"
 	depends on MAC
 	select CRC32
 	---help---
drivers/net/ethernet/8390/mac8390.c +10 -22
index 65cf60f6718c52fa..b9283901136e974a 100644
@@ -454,34 +454,22 @@ MODULE_AUTHOR("David Huggins-Daines <[email protected]> and others");
 MODULE_DESCRIPTION("Macintosh NS8390-based Nubus Ethernet driver");
 MODULE_LICENSE("GPL");
 
-/* overkill, of course */
-static struct net_device *dev_mac8390[15];
-int init_module(void)
+static struct net_device *dev_mac8390;
+
+int __init init_module(void)
 {
-	int i;
-	for (i = 0; i < 15; i++) {
-		struct net_device *dev = mac8390_probe(-1);
-		if (IS_ERR(dev))
-			break;
-		dev_mac890[i] = dev;
-	}
-	if (!i) {
-		pr_notice("No useable cards found, driver NOT installed.\n");
-		return -ENODEV;
+	dev_mac8390 = mac8390_probe(-1);
+	if (IS_ERR(dev_mac8390)) {
+		pr_warn("mac8390: No card found\n");
+		return PTR_ERR(dev_mac8390);
 	}
 	return 0;
 }
 
-void cleanup_module(void)
+void __exit cleanup_module(void)
 {
-	int i;
-	for (i = 0; i < 15; i++) {
-		struct net_device *dev = dev_mac890[i];
-		if (dev) {
-			unregister_netdev(dev);
-			free_netdev(dev);
-		}
-	}
+	unregister_netdev(dev_mac8390);
+	free_netdev(dev_mac8390);
 }
 
 #endif /* MODULE */
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH 1/5 net: mac8390: Allow modular build

In reply to Geert Uytterhoeven

The modular driver supports only one card, just like the built-in driver.

Note that this limitation is a problem which affects all Nubus card drivers, because they have to do all their own bus matching, because Nubus still lacks the necessary driver model support.

---
 drivers/net/ethernet/8390/Kconfig   |  2 +-
 drivers/net/ethernet/8390/mac8390.c | 32 ++++++++++----------------------
 2 files changed, 11 insertions(+), 23 deletions(-)
drivers/net/ethernet/8390/Kconfig +1 -1
index edf72258ab1ddabe..29c3075bfb052f1d 100644
@@ -64,7 +64,7 @@ config ARM_ETHERH
 	  should say Y to this option if you wish to use it with Linux.
 
 config MAC8390
-	bool "Macintosh NS 8390 based ethernet cards"
+	tristate "Macintosh NS 8390 based ethernet cards"
 	depends on MAC
 	select CRC32
 	---help---
drivers/net/ethernet/8390/mac8390.c +10 -22
index 65cf60f6718c52fa..b9283901136e974a 100644
@@ -454,34 +454,22 @@ MODULE_AUTHOR("David Huggins-Daines <[email protected]> and others");
 MODULE_DESCRIPTION("Macintosh NS8390-based Nubus Ethernet driver");
 MODULE_LICENSE("GPL");
 
-/* overkill, of course */
-static struct net_device *dev_mac8390[15];
-int init_module(void)
+static struct net_device *dev_mac8390;
+
+int __init init_module(void)
 {
-	int i;
-	for (i = 0; i < 15; i++) {
-		struct net_device *dev = mac8390_probe(-1);
-		if (IS_ERR(dev))
-			break;
-		dev_mac890[i] = dev;
-	}
-	if (!i) {
-		pr_notice("No useable cards found, driver NOT installed.\n");
-		return -ENODEV;
+	dev_mac8390 = mac8390_probe(-1);
+	if (IS_ERR(dev_mac8390)) {
+		pr_warn("mac8390: No card found\n");
+		return PTR_ERR(dev_mac8390);
 	}
 	return 0;
 }
 
-void cleanup_module(void)
+void __exit cleanup_module(void)
 {
-	int i;
-	for (i = 0; i < 15; i++) {
-		struct net_device *dev = dev_mac890[i];
-		if (dev) {
-			unregister_netdev(dev);
-			free_netdev(dev);
-		}
-	}
+	unregister_netdev(dev_mac8390);
+	free_netdev(dev_mac8390);
 }
 
 #endif /* MODULE */
Signature · 1 line
1.9.1
author maintainer
#3 lore raw

PATCH 2/5 net: 7990: Export lance_poll() to modules

In reply to Geert Uytterhoeven

If CONFIG_HPLANCE=m and CONFIG_NET_POLL_CONTROLLER=y:

ERROR: "lance_poll" [drivers/net/ethernet/amd/hplance.ko] undefined!

Add the missing export to fix this.

---
 drivers/net/ethernet/amd/7990.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/amd/7990.c +1 -0
index 98a10d555b793e02..66d0b73c39c03ba2 100644
@@ -661,6 +661,7 @@ void lance_poll(struct net_device *dev)
 	spin_unlock(&lp->devlock);
 	lance_interrupt(dev->irq, dev);
 }
+EXPORT_SYMBOL_GPL(lance_poll);
 #endif
 
 MODULE_LICENSE("GPL");
Signature · 1 line
1.9.1
author maintainer
#4 lore raw

PATCH 2/5 net: 7990: Export lance_poll() to modules

In reply to Geert Uytterhoeven

If CONFIG_HPLANCE=m and CONFIG_NET_POLL_CONTROLLER=y:

ERROR: "lance_poll" [drivers/net/ethernet/amd/hplance.ko] undefined!

Add the missing export to fix this.

---
 drivers/net/ethernet/amd/7990.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/amd/7990.c +1 -0
index 98a10d555b793e02..66d0b73c39c03ba2 100644
@@ -661,6 +661,7 @@ void lance_poll(struct net_device *dev)
 	spin_unlock(&lp->devlock);
 	lance_interrupt(dev->irq, dev);
 }
+EXPORT_SYMBOL_GPL(lance_poll);
 #endif
 
 MODULE_LICENSE("GPL");
Signature · 1 line
1.9.1
author maintainer
#5 lore raw

PATCH 3/5 net: hplance: Allow modular build

In reply to Geert Uytterhoeven
---
 drivers/net/ethernet/amd/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amd/Kconfig +1 -1
index afc62ea804fc35d4..0038709fd317d83c 100644
@@ -100,7 +100,7 @@ config DECLANCE
 	  DEPCA series.  (This chipset is better known via the NE2100 cards.)
 
 config HPLANCE
-	bool "HP on-board LANCE support"
+	tristate "HP on-board LANCE support"
 	depends on DIO
 	select CRC32
 	---help---
Signature · 1 line
1.9.1
author maintainer
#6 lore raw

PATCH 4/5 m68k/mac: Export Peripheral System Controller (PSC) base address to modules

In reply to Geert Uytterhoeven

If CONFIG_MACMACE=m:

ERROR: psc [drivers/net/ethernet/apple/macmace.ko] undefined!

Add the missing export to fix this.

---
I'm OK with this going in through the netdev tree, as "net: macmace:
Allow modular build" depends on it.

---
 arch/m68k/mac/psc.c | 1 +
 1 file changed, 1 insertion(+)
arch/m68k/mac/psc.c +1 -0
index cd38f29955c87421..2290c0cae48beb8a 100644
@@ -29,6 +29,7 @@
 
 int psc_present;
 volatile __u8 *psc;
+EXPORT_SYMBOL_GPL(psc);
 
 /*
  * Debugging dump, used in various places to see what's going on.
Signature · 1 line
1.9.1
author maintainer
#7 lore raw

PATCH 4/5 m68k/mac: Export Peripheral System Controller (PSC) base address to modules

In reply to Geert Uytterhoeven

If CONFIG_MACMACE=m:

ERROR: psc [drivers/net/ethernet/apple/macmace.ko] undefined!

Add the missing export to fix this.

---
I'm OK with this going in through the netdev tree, as "net: macmace:
Allow modular build" depends on it.

---
 arch/m68k/mac/psc.c | 1 +
 1 file changed, 1 insertion(+)
arch/m68k/mac/psc.c +1 -0
index cd38f29955c87421..2290c0cae48beb8a 100644
@@ -29,6 +29,7 @@
 
 int psc_present;
 volatile __u8 *psc;
+EXPORT_SYMBOL_GPL(psc);
 
 /*
  * Debugging dump, used in various places to see what's going on.
Signature · 1 line
1.9.1
author maintainer
#8 lore raw

PATCH 5/5 net: macmace: Allow modular build

In reply to Geert Uytterhoeven

---
This depends on "[PATCH 4/5] m68k/mac: Export Peripheral System Controller (PSC) base address to modules".

---
 drivers/net/ethernet/apple/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/apple/Kconfig +1 -1
index d19a41b0c6d26691..31071297896c96b5 100644
@@ -51,7 +51,7 @@ config BMAC
 	  will be called bmac.
 
 config MACMACE
-	bool "Macintosh (AV) onboard MACE ethernet"
+	tristate "Macintosh (AV) onboard MACE ethernet"
 	depends on MAC
 	select CRC32
 	---help---
Signature · 1 line
1.9.1
maintainer
#9 lore raw
In reply to Geert Uytterhoeven

From: Geert Uytterhoeven <[email protected]>
Date: Tue, 29 Sep 2015 10:24:01 +0200

Quoted 11 lines

This patch series makes the remaining m68k Ethernet drivers modular. It's an alternative to the last 3 patches of Paul Gortmaker's series "[PATCH net-next 0/6] make non-modular code explicitly non-modular".

Note that "[PATCH 5/5] net: macmace: Allow modular build" depends on "[PATCH 4/5] m68k/mac: Export Peripheral System Controller (PSC) base address to modules". Feel free to take the dependency through the netdev tree to avoid modular build breakage.

This was compile-tested only (mac_defconfig + allmodconfig) due to lack of hardware.

Series applied, thanks Geert.

maintainer
#10 lore raw
In reply to Geert Uytterhoeven

From: Geert Uytterhoeven <[email protected]>
Date: Tue, 29 Sep 2015 10:24:01 +0200

Quoted 11 lines

This patch series makes the remaining m68k Ethernet drivers modular. It's an alternative to the last 3 patches of Paul Gortmaker's series "[PATCH net-next 0/6] make non-modular code explicitly non-modular".

Note that "[PATCH 5/5] net: macmace: Allow modular build" depends on "[PATCH 4/5] m68k/mac: Export Peripheral System Controller (PSC) base address to modules". Feel free to take the dependency through the netdev tree to avoid modular build breakage.

This was compile-tested only (mac_defconfig + allmodconfig) due to lack of hardware.

Series applied, thanks Geert.