if (!dev)
return -ENOENT;
- if (!dev->enabled)
+ if (!dev->initialized)
return -ENODEV;
return dev->status;
dev->status = status;
- if (dev->enabled == false && strncmp(name, "USB", strlen("USB")) == 0) {
+ if (dev->initialized == false && strncmp(name, "USB", strlen("USB")) == 0) {
if (status > 0) {
snprintf(buf, BUF_MAX, "usb-client");
ret_dbus = gdbus_call_sync_with_reply_int(DEVICEMANAGER_BUS_NAME,
if (!dev)
return -ENODEV;
- if (dev->enabled) {
- _I("Extcon(%s) already enabled.", name);
+ if (dev->initialized) {
+ _I("Extcon(%s) already initialized.", name);
return 0;
}
dev->init(NULL);
- dev->enabled = true;
+ dev->initialized = true;
if (strncmp(name, "USB", strlen("USB")) == 0) {
ret = extcon_update("USB", NULL, "0");
if (ret != 0)
_E("Failed to connect USB.");
}
- _I("Extcon(%s) enabled.", name);
+ _I("Extcon(%s) initialized.", name);
return 0;
}
if (ret_dbus < 0)
_E("Failed to launch USB restricted popup: %d", ret_dbus);
- if (!dev->enabled) {
- _I("Extcon(%s) already disabled.", name);
+ if (!dev->initialized) {
+ _I("Extcon(%s) already deinitialized.", name);
return 0;
}
dev->exit(NULL);
- dev->enabled = false;
+ dev->initialized = false;
- _I("Extcon(%s) disabled.", name);
+ _I("Extcon(%s) deinitialized.", name);
return 0;
}
_I("Extcon(%s) init.", dev->name);
if (dev->init)
dev->init(NULL);
- dev->enabled = true;
+ dev->initialized = true;
}
event_handler_state_changed((void *)&state);
_I("Extcon(%s) deinit.", dev->name);
if (dev->exit)
dev->exit(data);
- dev->enabled = false;
+ dev->initialized = false;
}
extcon_dev_available = false;
}