static void
__device_free_unused(struct device *dev)
{
- if (!list_empty(&dev->users) || dev->current_config)
+ if (!list_empty(&dev->users) || dev->current_config || config_init)
return;
device_free(dev);
struct device *odev = NULL, *dev;
enum dev_change_type change;
- D(DEVICE, "Create new device '%s' (%s)\n", name, type->name);
config = config_memdup(config);
if (!config)
return NULL;
device_delete(odev);
break;
}
- }
+ } else
+ D(DEVICE, "Create new device '%s' (%s)\n", name, type->name);
dev = type->create(config);
if (!dev)