void register_wlags_sysfs(struct net_device *net)
{
- struct device *dev = &(net->dev);
- struct wl_private *lp = wl_priv(net);
-
- lp->sysfsCreated = sysfs_create_group(&dev->kobj, &wlags_group);
+ struct device *dev = &(net->dev);
+ struct wl_private *lp = wl_priv(net);
+ int err;
+ err = sysfs_create_group(&dev->kobj, &wlags_group);
+ if (!err)
+ lp->sysfsCreated = true;
}
void unregister_wlags_sysfs(struct net_device *net)
{
- struct device *dev = &(net->dev);
- struct wl_private *lp = wl_priv(net);
+ struct device *dev = &(net->dev);
+ struct wl_private *lp = wl_priv(net);
- if (lp->sysfsCreated)
- sysfs_remove_group(&dev->kobj, &wlags_group);
+ if (lp->sysfsCreated)
+ sysfs_remove_group(&dev->kobj, &wlags_group);
}