drivers/power/battery_gauge.c: Add missing initialization of semaphore.

drivers/power/battery_charger.c:  Add missing initialization of semaphore.
This commit is contained in:
Alan Carvalho de Assis 2019-01-04 10:27:49 -06:00 committed by Gregory Nutt
parent ea846b65c4
commit 3de2533599
2 changed files with 8 additions and 0 deletions

View File

@ -285,6 +285,10 @@ int battery_charger_register(FAR const char *devpath,
{ {
int ret; int ret;
/* Initialize the semaphore */
nxsem_init(&dev->batsem, 0, 1);
/* Register the character driver */ /* Register the character driver */
ret = register_driver(devpath, &g_batteryops, 0555, dev); ret = register_driver(devpath, &g_batteryops, 0555, dev);

View File

@ -248,6 +248,10 @@ int battery_gauge_register(FAR const char *devpath,
{ {
int ret; int ret;
/* Initialize the semaphore */
nxsem_init(&dev->batsem, 0, 1);
/* Register the character driver */ /* Register the character driver */
ret = register_driver(devpath, &g_batteryops, 0555, dev); ret = register_driver(devpath, &g_batteryops, 0555, dev);