Commit 0531d7b8 authored by Randy Dunlap's avatar Randy Dunlap Committed by David S. Miller

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: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Acked-by: default avatarDhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eef6dd65
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <net/ip.h> #include <net/ip.h>
#include <linux/ipv6.h> #include <linux/ipv6.h>
#include <linux/inetdevice.h> #include <linux/inetdevice.h>
#include <linux/sysfs.h>
MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -2500,6 +2501,7 @@ static struct bin_attribute bin_attr_mem = { ...@@ -2500,6 +2501,7 @@ static struct bin_attribute bin_attr_mem = {
.write = netxen_sysfs_write_mem, .write = netxen_sysfs_write_mem,
}; };
#ifdef CONFIG_MODULES
static ssize_t static ssize_t
netxen_store_auto_fw_reset(struct module_attribute *mattr, netxen_store_auto_fw_reset(struct module_attribute *mattr,
struct module *mod, const char *buf, size_t count) struct module *mod, const char *buf, size_t count)
...@@ -2534,6 +2536,7 @@ static struct module_attribute mod_attr_fw_reset = { ...@@ -2534,6 +2536,7 @@ static struct module_attribute mod_attr_fw_reset = {
.show = netxen_show_auto_fw_reset, .show = netxen_show_auto_fw_reset,
.store = netxen_store_auto_fw_reset, .store = netxen_store_auto_fw_reset,
}; };
#endif
static void static void
netxen_create_sysfs_entries(struct netxen_adapter *adapter) netxen_create_sysfs_entries(struct netxen_adapter *adapter)
...@@ -2739,7 +2742,9 @@ static struct pci_driver netxen_driver = { ...@@ -2739,7 +2742,9 @@ static struct pci_driver netxen_driver = {
static int __init netxen_init_module(void) static int __init netxen_init_module(void)
{ {
#ifdef CONFIG_MODULES
struct module *mod = THIS_MODULE; struct module *mod = THIS_MODULE;
#endif
printk(KERN_INFO "%s\n", netxen_nic_driver_string); printk(KERN_INFO "%s\n", netxen_nic_driver_string);
...@@ -2748,9 +2753,11 @@ static int __init netxen_init_module(void) ...@@ -2748,9 +2753,11 @@ static int __init netxen_init_module(void)
register_inetaddr_notifier(&netxen_inetaddr_cb); register_inetaddr_notifier(&netxen_inetaddr_cb);
#endif #endif
#ifdef CONFIG_MODULES
if (sysfs_create_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr)) if (sysfs_create_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr))
printk(KERN_ERR "%s: Failed to create auto_fw_reset " printk(KERN_ERR "%s: Failed to create auto_fw_reset "
"sysfs entry.", netxen_nic_driver_name); "sysfs entry.", netxen_nic_driver_name);
#endif
return pci_register_driver(&netxen_driver); return pci_register_driver(&netxen_driver);
} }
...@@ -2759,9 +2766,11 @@ module_init(netxen_init_module); ...@@ -2759,9 +2766,11 @@ module_init(netxen_init_module);
static void __exit netxen_exit_module(void) static void __exit netxen_exit_module(void)
{ {
#ifdef CONFIG_MODULES
struct module *mod = THIS_MODULE; struct module *mod = THIS_MODULE;
sysfs_remove_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr); sysfs_remove_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr);
#endif
pci_unregister_driver(&netxen_driver); pci_unregister_driver(&netxen_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment