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)
init_special_inode(inode, mode, dev);
break;
case S_IFREG:
inode->i_size = PAGE_SIZE;
inode->i_fop = &sysfs_file_operations;
break;
case S_IFDIR:
......
......@@ -2520,6 +2520,11 @@ int register_netdevice(struct net_device *dev)
if (d == dev || !strcmp(d->name, dev->name))
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,
* that should be never called and used as just bug trap.
......@@ -2547,10 +2552,7 @@ int register_netdevice(struct net_device *dev)
notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev);
net_run_sbin_hotplug(dev, "register");
snprintf(dev->kobj.name,KOBJ_NAME_LEN,dev->name);
kobj_set_kset_s(dev,net_subsys);
ret = kobject_register(&dev->kobj);
ret = 0;
out:
return ret;
......@@ -2676,8 +2678,6 @@ int unregister_netdevice(struct net_device *dev)
goto out;
}
kobject_unregister(&dev->kobj);
/* Last reference is our one */
if (atomic_read(&dev->refcnt) == 1)
goto out;
......@@ -2738,6 +2738,7 @@ int unregister_netdevice(struct net_device *dev)
}
}
out:
kobject_unregister(&dev->kobj);
dev_put(dev);
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