Remove unnecessary args from GPIO functions

Now that gpio_init() and read_gpios() doesn't use
D-Bus, they don't need the D-Bus connection parameter.

Change-Id: Id7f3ee6547bed7c0c0eed5d75cba2d6ff239d0fa
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/libopenbmc_intf/gpio.c b/libopenbmc_intf/gpio.c
index a33348b..33a9ffe 100644
--- a/libopenbmc_intf/gpio.c
+++ b/libopenbmc_intf/gpio.c
@@ -355,7 +355,7 @@
 }
 
 // Gets the gpio device path from gpio manager object
-int gpio_init(GDBusConnection *connection, GPIO* gpio)
+int gpio_init(GPIO* gpio)
 {
 	int rc = gpio_get_params(gpio);
 	if (rc != GPIO_OK)
diff --git a/libopenbmc_intf/gpio.h b/libopenbmc_intf/gpio.h
index a7ab8e2..dc439c8 100644
--- a/libopenbmc_intf/gpio.h
+++ b/libopenbmc_intf/gpio.h
@@ -24,7 +24,7 @@
 #define GPIO_WRITE_ERROR  0x10
 #define GPIO_LOOKUP_ERROR 0x20
 
-int gpio_init(GDBusConnection*, GPIO*);
+int gpio_init(GPIO*);
 void gpio_close(GPIO*);
 int  gpio_open(GPIO*);
 int gpio_open_interrupt(GPIO*, GIOFunc, gpointer);
diff --git a/libopenbmc_intf/gpio_configs.c b/libopenbmc_intf/gpio_configs.c
index a6ee8b6..93203c1 100644
--- a/libopenbmc_intf/gpio_configs.c
+++ b/libopenbmc_intf/gpio_configs.c
@@ -183,7 +183,7 @@
 	}
 }
 
-gboolean read_gpios(GDBusConnection *connection, GpioConfigs *gpios)
+gboolean read_gpios(GpioConfigs *gpios)
 {
 	cJSON* json = load_json();
 	if (json == NULL)
diff --git a/libopenbmc_intf/gpio_configs.h b/libopenbmc_intf/gpio_configs.h
index 233e27f..d462eb5 100644
--- a/libopenbmc_intf/gpio_configs.h
+++ b/libopenbmc_intf/gpio_configs.h
@@ -49,7 +49,7 @@
 } GpioConfigs;
 
 /* Read system configuration for GPIOs. */
-gboolean read_gpios(GDBusConnection *connection, GpioConfigs *gpios);
+gboolean read_gpios(GpioConfigs *gpios);
 /* Frees internal buffers. Does not free parameter. Does not close GPIOs. */
 void free_gpios(GpioConfigs *gpios);
 
diff --git a/op-pwrctl/power_control_obj.c b/op-pwrctl/power_control_obj.c
index 9c2b250..dedcbe2 100644
--- a/op-pwrctl/power_control_obj.c
+++ b/op-pwrctl/power_control_obj.c
@@ -346,9 +346,7 @@
 }
 
 static int
-set_up_gpio(GDBusConnection *connection,
-		PowerGpio *power_gpio,
-		ControlPower* control_power)
+set_up_gpio(PowerGpio *power_gpio, ControlPower* control_power)
 {
 	int error = GPIO_OK;
 	int rc;
@@ -357,29 +355,29 @@
 
 	// get gpio device paths
 	if(power_gpio->latch_out.name != NULL) {  /* latch is optional */
-		rc = gpio_init(connection, &power_gpio->latch_out);
+		rc = gpio_init(&power_gpio->latch_out);
 		if(rc != GPIO_OK) {
 			error = rc;
 		}
 	}
-	rc = gpio_init(connection, &power_gpio->power_good_in);
+	rc = gpio_init(&power_gpio->power_good_in);
 	if(rc != GPIO_OK) {
 		error = rc;
 	}
 	for(int i = 0; i < power_gpio->num_power_up_outs; i++) {
-		rc = gpio_init(connection, &power_gpio->power_up_outs[i]);
+		rc = gpio_init(&power_gpio->power_up_outs[i]);
 		if(rc != GPIO_OK) {
 			error = rc;
 		}
 	}
 	for(int i = 0; i < power_gpio->num_reset_outs; i++) {
-		rc = gpio_init(connection, &power_gpio->reset_outs[i]);
+		rc = gpio_init(&power_gpio->reset_outs[i]);
 		if(rc != GPIO_OK) {
 			error = rc;
 		}
 	}
 	for(int i = 0; i < power_gpio->num_pci_reset_outs; i++) {
-		rc = gpio_init(connection, &power_gpio->pci_reset_outs[i]);
+		rc = gpio_init(&power_gpio->pci_reset_outs[i]);
 		if(rc != GPIO_OK) {
 			error = rc;
 		}
@@ -462,12 +460,12 @@
 	g_dbus_object_manager_server_export(manager, G_DBUS_OBJECT_SKELETON(object));
 	g_object_unref(object);
 
-	if(read_gpios(connection, &g_gpio_configs) != TRUE) {
+	if(read_gpios(&g_gpio_configs) != TRUE) {
 		g_print("ERROR PowerControl: could not read power GPIO configuration\n");
 		exit(-1);
 	}
 
-	int rc = set_up_gpio(connection, &g_gpio_configs.power_gpio, control_power);
+	int rc = set_up_gpio(&g_gpio_configs.power_gpio, control_power);
 	if(rc != GPIO_OK) {
 		g_print("ERROR PowerControl: GPIO setup (rc=%d)\n",rc);
 		exit(-1);
diff --git a/pciedetect/pcie_slot_present_obj.c b/pciedetect/pcie_slot_present_obj.c
index 4828051..0dc4475 100644
--- a/pciedetect/pcie_slot_present_obj.c
+++ b/pciedetect/pcie_slot_present_obj.c
@@ -108,11 +108,11 @@
 }
 
 int
-get_presence(GDBusConnection* connection, GPIO* gpio, uint8_t* present)
+get_presence(GPIO* gpio, uint8_t* present)
 {
 	int rc = GPIO_OK;
 	do {
-		rc = gpio_init(connection,gpio);
+		rc = gpio_init(gpio);
 		if(rc != GPIO_OK) { break; }
 		uint8_t gpio_val;
 		rc = gpio_open(gpio);
@@ -204,7 +204,7 @@
 		do {
 			rc = get_object(c,sys_proxy,&slots[i],&obj_info);
 			if(rc) { break; }
-			rc = get_presence(c,&slots[i],&present);
+			rc = get_presence(&slots[i],&present);
 			//if (rc) { break; }
 			// TODO: send correct state
 			if(present == 0) {
diff --git a/pwrbutton/button_power_obj.c b/pwrbutton/button_power_obj.c
index 58a9cad..2c3d32f 100644
--- a/pwrbutton/button_power_obj.c
+++ b/pwrbutton/button_power_obj.c
@@ -113,7 +113,7 @@
 	// get gpio device paths
 	int rc = GPIO_OK;
 	do {
-		rc = gpio_init(connection,&gpio_button);
+		rc = gpio_init(&gpio_button);
 		gpio_inits_done();
 		if(rc != GPIO_OK) { break; }
 		rc = gpio_open_interrupt(&gpio_button,on_button_interrupt,object);
diff --git a/rstbutton/button_reset_obj.c b/rstbutton/button_reset_obj.c
index 245c3c1..96fceb1 100644
--- a/rstbutton/button_reset_obj.c
+++ b/rstbutton/button_reset_obj.c
@@ -113,7 +113,7 @@
 	// get gpio device paths
 	int rc = GPIO_OK;
 	do {
-		rc = gpio_init(connection,&gpio_button);
+		rc = gpio_init(&gpio_button);
 		gpio_inits_done();
 		if(rc != GPIO_OK) { break; }
 		rc = gpio_open_interrupt(&gpio_button,on_button_interrupt,object);