]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: interface: Preserve data received during hotplug event
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 12 Aug 2015 03:49:31 +0000 (09:19 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 12 Aug 2015 04:57:12 +0000 (21:57 -0700)
This shall be used later to find a firmware blob for the interface, lets
save it in the interface structure.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/interface.h
drivers/staging/greybus/svc.c

index e60a3705494ee6e5cf46084d6f80fd133f6dae4c..38210ad4e631f78e52be323689d68d6defa5a4db 100644 (file)
@@ -28,6 +28,12 @@ struct gb_interface {
        char *product_string;
        u64 unique_id;
 
+       /* Information taken from the hotplug event */
+       u32 unipro_mfg_id;
+       u32 unipro_prod_id;
+       u32 ara_vend_id;
+       u32 ara_prod_id;
+
        struct gb_module *module;
        struct greybus_host_device *hd;
 };
index 025b2bad94280b2687b9bc6a494142afe77da1c8..73e7947fadba28e6efd7a9c1e58185d787941a3a 100644 (file)
@@ -232,10 +232,6 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
        struct device *dev = &op->connection->dev;
        struct gb_interface *intf;
        u8 intf_id, device_id;
-       u32 unipro_mfg_id;
-       u32 unipro_prod_id;
-       u32 ara_vend_id;
-       u32 ara_prod_id;
        int ret;
 
        if (request->payload_size < sizeof(*hotplug)) {
@@ -252,10 +248,6 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
         * XXX have the SVC get acknowledgement before we proceed.
         */
        intf_id = hotplug->intf_id;
-       unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id);
-       unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id);
-       ara_vend_id = le32_to_cpu(hotplug->data.ara_vend_id);
-       ara_prod_id = le32_to_cpu(hotplug->data.ara_prod_id);
 
        intf = gb_interface_create(hd, intf_id);
        if (!intf) {
@@ -264,6 +256,11 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
                return -EINVAL;
        }
 
+       intf->unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id);
+       intf->unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id);
+       intf->ara_vend_id = le32_to_cpu(hotplug->data.ara_vend_id);
+       intf->ara_prod_id = le32_to_cpu(hotplug->data.ara_prod_id);
+
        /*
         * Create a device id for the interface:
         * - device id 0 (GB_DEVICE_ID_SVC) belongs to the SVC