Commit 59507e26 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: connection: add helper to create control connections

Add dedicated helper to create control connections.

This will allow us to simplify the generic (dynamic) interface.
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent bafe3f67
...@@ -222,6 +222,12 @@ gb_connection_create_static(struct gb_host_device *hd, u16 hd_cport_id) ...@@ -222,6 +222,12 @@ gb_connection_create_static(struct gb_host_device *hd, u16 hd_cport_id)
return gb_connection_create(hd, hd_cport_id, NULL, NULL, 0, 0); return gb_connection_create(hd, hd_cport_id, NULL, NULL, 0, 0);
} }
struct gb_connection *
gb_connection_create_control(struct gb_interface *intf)
{
return gb_connection_create(intf->hd, -1, intf, NULL, 0, 0);
}
struct gb_connection * struct gb_connection *
gb_connection_create_dynamic(struct gb_interface *intf, gb_connection_create_dynamic(struct gb_interface *intf,
struct gb_bundle *bundle, struct gb_bundle *bundle,
......
...@@ -57,6 +57,7 @@ struct gb_connection { ...@@ -57,6 +57,7 @@ struct gb_connection {
struct gb_connection *gb_connection_create_static(struct gb_host_device *hd, struct gb_connection *gb_connection_create_static(struct gb_host_device *hd,
u16 hd_cport_id); u16 hd_cport_id);
struct gb_connection *gb_connection_create_control(struct gb_interface *intf);
struct gb_connection *gb_connection_create_dynamic(struct gb_interface *intf, struct gb_connection *gb_connection_create_dynamic(struct gb_interface *intf,
struct gb_bundle *bundle, u16 cport_id, struct gb_bundle *bundle, u16 cport_id,
u8 protocol_id); u8 protocol_id);
......
...@@ -186,9 +186,7 @@ struct gb_control *gb_control_create(struct gb_interface *intf) ...@@ -186,9 +186,7 @@ struct gb_control *gb_control_create(struct gb_interface *intf)
if (!control) if (!control)
return NULL; return NULL;
control->connection = gb_connection_create_dynamic(intf, NULL, control->connection = gb_connection_create_control(intf);
GB_CONTROL_CPORT_ID,
GREYBUS_PROTOCOL_CONTROL);
if (!control->connection) { if (!control->connection) {
dev_err(&intf->dev, "failed to create control connection\n"); dev_err(&intf->dev, "failed to create control connection\n");
kfree(control); kfree(control);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment