aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2006-12-19 00:21:10 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-26 16:28:20 -0500
commitce9f7fe3c3f5b9ed1d3e91db78c45d0df5672816 (patch)
treecd09231fef5eca25d6ffcbf1d27abad04bf1afaa
parent683a2aa339f607c8a422835161ceab68b2a5a18a (diff)
via-velocity uses INET interfaces
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> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/via-velocity.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 4587f23f4e4b..8e5d82051bd4 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -265,15 +265,19 @@ static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status);
265static int velocity_suspend(struct pci_dev *pdev, pm_message_t state); 265static int velocity_suspend(struct pci_dev *pdev, pm_message_t state);
266static int velocity_resume(struct pci_dev *pdev); 266static int velocity_resume(struct pci_dev *pdev);
267 267
268static DEFINE_SPINLOCK(velocity_dev_list_lock);
269static LIST_HEAD(velocity_dev_list);
270
271#endif
272
273#if defined(CONFIG_PM) && defined(CONFIG_INET)
274
268static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr); 275static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr);
269 276
270static struct notifier_block velocity_inetaddr_notifier = { 277static struct notifier_block velocity_inetaddr_notifier = {
271 .notifier_call = velocity_netdev_event, 278 .notifier_call = velocity_netdev_event,
272}; 279};
273 280
274static DEFINE_SPINLOCK(velocity_dev_list_lock);
275static LIST_HEAD(velocity_dev_list);
276
277static void velocity_register_notifier(void) 281static void velocity_register_notifier(void)
278{ 282{
279 register_inetaddr_notifier(&velocity_inetaddr_notifier); 283 register_inetaddr_notifier(&velocity_inetaddr_notifier);
@@ -284,12 +288,12 @@ static void velocity_unregister_notifier(void)
284 unregister_inetaddr_notifier(&velocity_inetaddr_notifier); 288 unregister_inetaddr_notifier(&velocity_inetaddr_notifier);
285} 289}
286 290
287#else /* CONFIG_PM */ 291#else
288 292
289#define velocity_register_notifier() do {} while (0) 293#define velocity_register_notifier() do {} while (0)
290#define velocity_unregister_notifier() do {} while (0) 294#define velocity_unregister_notifier() do {} while (0)
291 295
292#endif /* !CONFIG_PM */ 296#endif
293 297
294/* 298/*
295 * Internal board variants. At the moment we have only one 299 * Internal board variants. At the moment we have only one
@@ -3292,6 +3296,8 @@ static int velocity_resume(struct pci_dev *pdev)
3292 return 0; 3296 return 0;
3293} 3297}
3294 3298
3299#ifdef CONFIG_INET
3300
3295static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr) 3301static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr)
3296{ 3302{
3297 struct in_ifaddr *ifa = (struct in_ifaddr *) ptr; 3303 struct in_ifaddr *ifa = (struct in_ifaddr *) ptr;
@@ -3312,4 +3318,6 @@ static int velocity_netdev_event(struct notifier_block *nb, unsigned long notifi
3312 } 3318 }
3313 return NOTIFY_DONE; 3319 return NOTIFY_DONE;
3314} 3320}
3321
3322#endif
3315#endif 3323#endif