summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2018-08-07 16:26:55 -0500
committerMatt Spinler <spinler@us.ibm.com>2018-08-14 15:42:00 -0500
commit0f0946bef6fb613b65b344b966e44452270d0e82 (patch)
treee196b0d6cb471f1eb776b7bc44c18c0c75e73c9a
parent6a07a6c940b0d7c135049796d48c1f21bd32aa8c (diff)
downloadblackbird-skeleton-0f0946bef6fb613b65b344b966e44452270d0e82.tar.gz
blackbird-skeleton-0f0946bef6fb613b65b344b966e44452270d0e82.zip
Call gpio_inits_done() from GPIO consumers
This frees the cJSON structures that were created in the gpio_init() calls. Doing it this way allows the JSON to be parsed only once across multiple gpio_init() calls. Change-Id: Ia2c37c941b458fe271287b441c30b00dcb67d742 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
-rw-r--r--op-pwrctl/power_control_obj.c2
-rw-r--r--pciedetect/pcie_slot_present_obj.c1
-rw-r--r--pwrbutton/button_power_obj.c1
-rw-r--r--rstbutton/button_reset_obj.c1
4 files changed, 5 insertions, 0 deletions
diff --git a/op-pwrctl/power_control_obj.c b/op-pwrctl/power_control_obj.c
index e9c9673..9c2b250 100644
--- a/op-pwrctl/power_control_obj.c
+++ b/op-pwrctl/power_control_obj.c
@@ -385,6 +385,8 @@ set_up_gpio(GDBusConnection *connection,
}
}
+ gpio_inits_done();
+
rc = gpio_open(&power_gpio->power_good_in);
if(rc != GPIO_OK) {
return rc;
diff --git a/pciedetect/pcie_slot_present_obj.c b/pciedetect/pcie_slot_present_obj.c
index 01aeff4..4828051 100644
--- a/pciedetect/pcie_slot_present_obj.c
+++ b/pciedetect/pcie_slot_present_obj.c
@@ -126,6 +126,7 @@ get_presence(GDBusConnection* connection, GPIO* gpio, uint8_t* present)
{
printf("ERROR pcie_slot_present: GPIO error %s (rc=%d)\n",gpio->name,rc);
}
+ gpio_inits_done();
return rc;
}
diff --git a/pwrbutton/button_power_obj.c b/pwrbutton/button_power_obj.c
index 7b27986..58a9cad 100644
--- a/pwrbutton/button_power_obj.c
+++ b/pwrbutton/button_power_obj.c
@@ -114,6 +114,7 @@ on_bus_acquired(GDBusConnection *connection,
int rc = GPIO_OK;
do {
rc = gpio_init(connection,&gpio_button);
+ gpio_inits_done();
if(rc != GPIO_OK) { break; }
rc = gpio_open_interrupt(&gpio_button,on_button_interrupt,object);
if(rc != GPIO_OK) { break; }
diff --git a/rstbutton/button_reset_obj.c b/rstbutton/button_reset_obj.c
index 8e1c1ac..245c3c1 100644
--- a/rstbutton/button_reset_obj.c
+++ b/rstbutton/button_reset_obj.c
@@ -114,6 +114,7 @@ on_bus_acquired(GDBusConnection *connection,
int rc = GPIO_OK;
do {
rc = gpio_init(connection,&gpio_button);
+ gpio_inits_done();
if(rc != GPIO_OK) { break; }
rc = gpio_open_interrupt(&gpio_button,on_button_interrupt,object);
if(rc != GPIO_OK) { break; }
OpenPOWER on IntegriCloud