Commit ec9526e9 authored by Patrick Mochel's avatar Patrick Mochel

Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin

into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core
parents 27d23d3f 6ac4a2a4
This diff is collapsed.
...@@ -72,6 +72,7 @@ static struct inode *sysfs_get_inode(struct super_block *sb, int mode, int dev) ...@@ -72,6 +72,7 @@ static struct inode *sysfs_get_inode(struct super_block *sb, int mode, int dev)
init_special_inode(inode, mode, dev); init_special_inode(inode, mode, dev);
break; break;
case S_IFREG: case S_IFREG:
inode->i_size = PAGE_SIZE;
inode->i_fop = &sysfs_file_operations; inode->i_fop = &sysfs_file_operations;
break; break;
case S_IFDIR: case S_IFDIR:
......
...@@ -2520,6 +2520,11 @@ int register_netdevice(struct net_device *dev) ...@@ -2520,6 +2520,11 @@ int register_netdevice(struct net_device *dev)
if (d == dev || !strcmp(d->name, dev->name)) if (d == dev || !strcmp(d->name, dev->name))
goto out_err; goto out_err;
} }
snprintf(dev->kobj.name,KOBJ_NAME_LEN,dev->name);
kobj_set_kset_s(dev,net_subsys);
if ((ret = kobject_register(&dev->kobj)))
goto out_err;
/* /*
* nil rebuild_header routine, * nil rebuild_header routine,
* that should be never called and used as just bug trap. * that should be never called and used as just bug trap.
...@@ -2547,10 +2552,7 @@ int register_netdevice(struct net_device *dev) ...@@ -2547,10 +2552,7 @@ int register_netdevice(struct net_device *dev)
notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev); notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev);
net_run_sbin_hotplug(dev, "register"); net_run_sbin_hotplug(dev, "register");
ret = 0;
snprintf(dev->kobj.name,KOBJ_NAME_LEN,dev->name);
kobj_set_kset_s(dev,net_subsys);
ret = kobject_register(&dev->kobj);
out: out:
return ret; return ret;
...@@ -2676,8 +2678,6 @@ int unregister_netdevice(struct net_device *dev) ...@@ -2676,8 +2678,6 @@ int unregister_netdevice(struct net_device *dev)
goto out; goto out;
} }
kobject_unregister(&dev->kobj);
/* Last reference is our one */ /* Last reference is our one */
if (atomic_read(&dev->refcnt) == 1) if (atomic_read(&dev->refcnt) == 1)
goto out; goto out;
...@@ -2738,6 +2738,7 @@ int unregister_netdevice(struct net_device *dev) ...@@ -2738,6 +2738,7 @@ int unregister_netdevice(struct net_device *dev)
} }
} }
out: out:
kobject_unregister(&dev->kobj);
dev_put(dev); dev_put(dev);
return 0; return 0;
} }
......
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