diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-04-13 19:19:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-04-21 10:09:03 +0900 |
commit | 7c8eb12dbb4c1b43ce705a8ba1a5c9c1191e75d8 (patch) | |
tree | 3fce31fc4978c18503e4bf101708416f586f21c8 /drivers/staging/greybus/manifest.c | |
parent | 7326e07b588cace823a36d4a563838b051b8b8a5 (diff) |
greybus: interface: move vendor and product strings to control device
The control device is an abstraction of the control connection over
which a greybus manifest is retrieved. As interfaces switch modes (e.g.
after boot-over-unipro) they expose new manifests, which can contain
different vendor and product strings.
Eventually control devices will be deregistered and recreated after an
interface mode switch, while the interface itself remains registered.
Note that only interfaces of type greybus will have control devices.
Specifically, dummy interfaces will not.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/manifest.c')
-rw-r--r-- | drivers/staging/greybus/manifest.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/staging/greybus/manifest.c b/drivers/staging/greybus/manifest.c index cca4592c15ad..886c5fb91d9f 100644 --- a/drivers/staging/greybus/manifest.c +++ b/drivers/staging/greybus/manifest.c @@ -384,18 +384,19 @@ static bool gb_manifest_parse_interface(struct gb_interface *intf, struct manifest_desc *interface_desc) { struct greybus_descriptor_interface *desc_intf = interface_desc->data; + struct gb_control *control = intf->control; char *str; /* Handle the strings first--they can fail */ str = gb_string_get(intf, desc_intf->vendor_stringid); if (IS_ERR(str)) return false; - intf->vendor_string = str; + control->vendor_string = str; str = gb_string_get(intf, desc_intf->product_stringid); if (IS_ERR(str)) goto out_free_vendor_string; - intf->product_string = str; + control->product_string = str; /* Release the interface descriptor, now that we're done with it */ release_manifest_descriptor(interface_desc); @@ -408,11 +409,11 @@ static bool gb_manifest_parse_interface(struct gb_interface *intf, return true; out_err: - kfree(intf->product_string); - intf->product_string = NULL; + kfree(control->product_string); + control->product_string = NULL; out_free_vendor_string: - kfree(intf->vendor_string); - intf->vendor_string = NULL; + kfree(control->vendor_string); + control->vendor_string = NULL; return false; } |