aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2009-10-26 08:09:45 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 05:36:24 -0400
commit0531d7b85177cda05f574ddf0aa4b25050159101 (patch)
tree3ae80d666da366187fafc4bcd514fe41c0ae804c /drivers/net/netxen
parenteef6dd65e331d6e91a39b90344c705bbcbe0825e (diff)
netxen: fix builds for SYSFS=n or MODULES=n
When CONFIG_MODULES=n: drivers/net/netxen/netxen_nic_main.c:2751: error: dereferencing pointer to incomplete type drivers/net/netxen/netxen_nic_main.c:2764: error: dereferencing pointer to incomplete type Also needs addition of <linux/sysfs.h> for sysfs function prototypes or stubs when CONFIG_SYSFS=n. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index c2bdfd3c7aa..fe4059ff82f 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -34,6 +34,7 @@
34#include <net/ip.h> 34#include <net/ip.h>
35#include <linux/ipv6.h> 35#include <linux/ipv6.h>
36#include <linux/inetdevice.h> 36#include <linux/inetdevice.h>
37#include <linux/sysfs.h>
37 38
38MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); 39MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
39MODULE_LICENSE("GPL"); 40MODULE_LICENSE("GPL");
@@ -2500,6 +2501,7 @@ static struct bin_attribute bin_attr_mem = {
2500 .write = netxen_sysfs_write_mem, 2501 .write = netxen_sysfs_write_mem,
2501}; 2502};
2502 2503
2504#ifdef CONFIG_MODULES
2503static ssize_t 2505static ssize_t
2504netxen_store_auto_fw_reset(struct module_attribute *mattr, 2506netxen_store_auto_fw_reset(struct module_attribute *mattr,
2505 struct module *mod, const char *buf, size_t count) 2507 struct module *mod, const char *buf, size_t count)
@@ -2534,6 +2536,7 @@ static struct module_attribute mod_attr_fw_reset = {
2534 .show = netxen_show_auto_fw_reset, 2536 .show = netxen_show_auto_fw_reset,
2535 .store = netxen_store_auto_fw_reset, 2537 .store = netxen_store_auto_fw_reset,
2536}; 2538};
2539#endif
2537 2540
2538static void 2541static void
2539netxen_create_sysfs_entries(struct netxen_adapter *adapter) 2542netxen_create_sysfs_entries(struct netxen_adapter *adapter)
@@ -2739,7 +2742,9 @@ static struct pci_driver netxen_driver = {
2739 2742
2740static int __init netxen_init_module(void) 2743static int __init netxen_init_module(void)
2741{ 2744{
2745#ifdef CONFIG_MODULES
2742 struct module *mod = THIS_MODULE; 2746 struct module *mod = THIS_MODULE;
2747#endif
2743 2748
2744 printk(KERN_INFO "%s\n", netxen_nic_driver_string); 2749 printk(KERN_INFO "%s\n", netxen_nic_driver_string);
2745 2750
@@ -2748,9 +2753,11 @@ static int __init netxen_init_module(void)
2748 register_inetaddr_notifier(&netxen_inetaddr_cb); 2753 register_inetaddr_notifier(&netxen_inetaddr_cb);
2749#endif 2754#endif
2750 2755
2756#ifdef CONFIG_MODULES
2751 if (sysfs_create_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr)) 2757 if (sysfs_create_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr))
2752 printk(KERN_ERR "%s: Failed to create auto_fw_reset " 2758 printk(KERN_ERR "%s: Failed to create auto_fw_reset "
2753 "sysfs entry.", netxen_nic_driver_name); 2759 "sysfs entry.", netxen_nic_driver_name);
2760#endif
2754 2761
2755 return pci_register_driver(&netxen_driver); 2762 return pci_register_driver(&netxen_driver);
2756} 2763}
@@ -2759,9 +2766,11 @@ module_init(netxen_init_module);
2759 2766
2760static void __exit netxen_exit_module(void) 2767static void __exit netxen_exit_module(void)
2761{ 2768{
2769#ifdef CONFIG_MODULES
2762 struct module *mod = THIS_MODULE; 2770 struct module *mod = THIS_MODULE;
2763 2771
2764 sysfs_remove_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr); 2772 sysfs_remove_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr);
2773#endif
2765 2774
2766 pci_unregister_driver(&netxen_driver); 2775 pci_unregister_driver(&netxen_driver);
2767 2776