/* Is used on I2O controller removal or LCT modification, when the device is removed from the system. Note that the device could still hang around until the refcount reaches 0.  */
void i2o_device_remove(struct i2o_device *i2o_dev)
/* Is used on I2O controller removal or LCT modification, when the device is removed from the system. Note that the device could still hang around until the refcount reaches 0.  */
void i2o_device_remove(struct i2o_device *i2o_dev)
{
	struct i2o_device *tmp;
	struct i2o_controller *c = i2o_dev->iop;
	i2o_driver_notify_device_remove_all(i2o_dev);
	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");
	}
	list_del(&i2o_dev->list);
	device_unregister(&i2o_dev->device);
}