-}
-
-static void i2o_remove_sysfs_links(struct i2o_device *i2o_dev)
-{
- struct i2o_controller *c = i2o_dev->iop;
- struct i2o_device *tmp;
-
- sysfs_remove_link(&i2o_dev->device.kobj, "parent");
- sysfs_remove_link(&i2o_dev->device.kobj, "user");
-
- list_for_each_entry(tmp, &c->devices, list) {
- if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
- sysfs_remove_link(&tmp->device.kobj, "parent");
- if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
- sysfs_remove_link(&tmp->device.kobj, "user");
- }
-}
-
-
-
-/**
- * i2o_device_add - allocate a new I2O device and add it to the IOP
- * @iop: I2O controller where the device is on
- * @entry: LCT entry of the I2O device
- *
- * Allocate a new I2O device and initialize it with the LCT entry. The
- * device is appended to the device list of the controller.
- *
- * Returns a pointer to the I2O device on success or negative error code
- * on failure.
- */
-static struct i2o_device *i2o_device_add(struct i2o_controller *c,
- i2o_lct_entry * entry)
-{
- struct i2o_device *dev;
-
- dev = i2o_device_alloc();
- if (IS_ERR(dev)) {
- printk(KERN_ERR "i2o: unable to allocate i2o device\n");
- return dev;
- }
-
- dev->lct_data = *entry;
- dev->iop = c;
-
- snprintf(dev->device.bus_id, BUS_ID_SIZE, "%d:%03x", c->unit,
- dev->lct_data.tid);
-
- dev->device.parent = &c->device;
-
- device_register(&dev->device);
-
- list_add_tail(&dev->list, &c->devices);