netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] via-velocity uses INET interfaces
@ 2006-12-19  5:21 Randy Dunlap
  2006-12-26 21:28 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2006-12-19  5:21 UTC (permalink / raw)
  To: netdev; +Cc: jgarzik

From: Randy Dunlap <randy.dunlap@oracle.com>

via-velocity doesn't build when CONFIG_INET=n:

drivers/built-in.o: In function `velocity_unregister_notifier':
via-velocity.c:(.text+0xe9b46): undefined reference to `unregister_inetaddr_notifier'
drivers/built-in.o: In function `velocity_init_module':
via-velocity.c:(.init.text+0xa027): undefined reference to `register_inetaddr_notifier'

I wanted to make this change in drivers/net/Kconfig, but
this isn't legal kconfig language:

 config VIA_VELOCITY
        tristate "VIA Velocity support"
        depends on NET_PCI && PCI
+       depends on INET if PM
        select CRC32
        select CRC_CCITT
        select MII

so fix it in via-velocity.c instead.
Builds with all 4 combinations of CONFIG_NET & CONFIG_PM.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/net/via-velocity.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

--- linux-2620-rc1g4.orig/drivers/net/via-velocity.c
+++ linux-2620-rc1g4/drivers/net/via-velocity.c
@@ -265,15 +265,19 @@ static int velocity_set_media_mode(struc
 static int velocity_suspend(struct pci_dev *pdev, pm_message_t state);
 static int velocity_resume(struct pci_dev *pdev);
 
+static DEFINE_SPINLOCK(velocity_dev_list_lock);
+static LIST_HEAD(velocity_dev_list);
+
+#endif
+
+#if defined(CONFIG_PM) && defined(CONFIG_INET)
+
 static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr);
 
 static struct notifier_block velocity_inetaddr_notifier = {
       .notifier_call	= velocity_netdev_event,
 };
 
-static DEFINE_SPINLOCK(velocity_dev_list_lock);
-static LIST_HEAD(velocity_dev_list);
-
 static void velocity_register_notifier(void)
 {
 	register_inetaddr_notifier(&velocity_inetaddr_notifier);
@@ -284,12 +288,12 @@ static void velocity_unregister_notifier
 	unregister_inetaddr_notifier(&velocity_inetaddr_notifier);
 }
 
-#else				/* CONFIG_PM */
+#else
 
 #define velocity_register_notifier()	do {} while (0)
 #define velocity_unregister_notifier()	do {} while (0)
 
-#endif				/* !CONFIG_PM */
+#endif
 
 /*
  *	Internal board variants. At the moment we have only one
@@ -3292,6 +3296,8 @@ static int velocity_resume(struct pci_de
 	return 0;
 }
 
+#ifdef CONFIG_INET
+
 static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr)
 {
 	struct in_ifaddr *ifa = (struct in_ifaddr *) ptr;
@@ -3312,4 +3318,6 @@ static int velocity_netdev_event(struct 
 	}
 	return NOTIFY_DONE;
 }
+
+#endif
 #endif


---

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-26 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19  5:21 [PATCH] via-velocity uses INET interfaces Randy Dunlap
2006-12-26 21:28 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).