module/battery: no need to lock before we've signaled ready

This commit is contained in:
Daniel Eklöf 2018-12-19 20:24:36 +01:00
parent 3413232ed6
commit 2c7362fefa

View file

@ -143,8 +143,6 @@ run(struct module_run_context *ctx)
int base_dir_fd = openat(pw_fd, m->battery, O_RDONLY);
assert(base_dir_fd != -1);
mtx_lock(&ctx->module->lock);
{
int fd = openat(base_dir_fd, "manufacturer", O_RDONLY);
assert(fd != -1);
@ -182,8 +180,6 @@ run(struct module_run_context *ctx)
m->battery, m->manufacturer, m->model,
100.0 * m->energy_full / energy_full_design);
mtx_unlock(&ctx->module->lock);
int status_fd = openat(base_dir_fd, "status", O_RDONLY);
assert(status_fd != -1);