greybus: begin abstracting connection operations

This is part 1 of abstracting the connection operations into a set
of methods.  This will avoid some big switch statements, but more
importantly this will be needed for supporting multiple versions of
each protocol.

For now only two methods are defined.  The init method is used
to set up the device (or whatever the CPort represents) and the exit
method tears it down.  There may need to be additional operations
added in the future, and once versioning is used we might stash
the version number in this structure as well.

The next patch adds dynamic registratration of these protocol
handlers, and will do away with the switch statement now found
in gb_connection_init().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h
index deb34f1..f907e0f 100644
--- a/drivers/staging/greybus/greybus.h
+++ b/drivers/staging/greybus/greybus.h
@@ -266,14 +266,10 @@
 extern struct bus_type greybus_bus_type;
 extern const struct attribute_group *greybus_module_groups[];
 
-int gb_i2c_device_init(struct gb_connection *connection);
-void gb_i2c_device_exit(struct gb_connection *connection);
-
-int gb_battery_device_init(struct gb_connection *connection);
-void gb_battery_device_exit(struct gb_connection *connection);
-
-int gb_gpio_controller_init(struct gb_connection *connection);
-void gb_gpio_controller_exit(struct gb_connection *connection);
+extern struct gb_connection_handler gb_i2c_connection_handler;
+extern struct gb_connection_handler gb_gpio_connection_handler;
+extern struct gb_connection_handler gb_battery_connection_handler;
+extern struct gb_connection_handler gb_uart_connection_handler;
 
 int gb_uart_device_init(struct gb_connection *connection);
 void gb_uart_device_exit(struct gb_connection *connection);