greybus: fix vendor and product matching

Fix vendor and product matching by matching on the 32-bit Ara vendor and
product ids.

Remove the "fake" 16-bit vendor and product ids and export the Ara ids
using the "vendor" and "product" interface attributes instead.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
diff --git a/drivers/staging/greybus/firmware.c b/drivers/staging/greybus/firmware.c
index a95be08..e99d8d6 100644
--- a/drivers/staging/greybus/firmware.c
+++ b/drivers/staging/greybus/firmware.c
@@ -41,7 +41,7 @@
 	snprintf(firmware_name, sizeof(firmware_name),
 		 "ara:%08x:%08x:%08x:%08x:%02x.tftf",
 		 intf->unipro_mfg_id, intf->unipro_prod_id,
-		 intf->ara_vend_id, intf->ara_prod_id, stage);
+		 intf->vendor, intf->product, stage);
 
 	return request_firmware(&firmware->fw, firmware_name,
 				&connection->bundle->dev);
diff --git a/drivers/staging/greybus/greybus_id.h b/drivers/staging/greybus/greybus_id.h
index 68d2e95..c91e7be 100644
--- a/drivers/staging/greybus/greybus_id.h
+++ b/drivers/staging/greybus/greybus_id.h
@@ -11,8 +11,8 @@
 
 struct greybus_bundle_id {
 	__u16	match_flags;
-	__u16	vendor;
-	__u16	product;
+	__u32	vendor;
+	__u32	product;
 	__u8	class;
 
 	kernel_ulong_t	driver_info __aligned(sizeof(kernel_ulong_t));
diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h
index f0ef4e9..28d2bac 100644
--- a/drivers/staging/greybus/interface.h
+++ b/drivers/staging/greybus/interface.h
@@ -22,16 +22,14 @@
 	u8 device_id;		/* Device id allocated for the interface block by the SVC */
 
 	/* Information taken from the manifest descriptor */
-	u16 vendor;
-	u16 product;
 	char *vendor_string;
 	char *product_string;
 
 	/* Information taken from the hotplug event */
 	u32 unipro_mfg_id;
 	u32 unipro_prod_id;
-	u32 ara_vend_id;
-	u32 ara_prod_id;
+	u32 vendor;
+	u32 product;
 
 	struct gb_module *module;
 	struct gb_host_device *hd;
diff --git a/drivers/staging/greybus/manifest.c b/drivers/staging/greybus/manifest.c
index 4b4dd99..c80a849 100644
--- a/drivers/staging/greybus/manifest.c
+++ b/drivers/staging/greybus/manifest.c
@@ -392,11 +392,6 @@
 	if (IS_ERR(intf->product_string))
 		goto out_free_vendor_string;
 
-	// FIXME
-	// Vendor, Product and Unique id must come via control protocol
-	intf->vendor = 0xffff;
-	intf->product = 0x0001;
-
 	/* Release the interface descriptor, now that we're done with it */
 	release_manifest_descriptor(interface_desc);
 
diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index bd04567..1acd0f7 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -460,8 +460,8 @@
 
 	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);
+	intf->vendor = le32_to_cpu(hotplug->data.ara_vend_id);
+	intf->product = le32_to_cpu(hotplug->data.ara_prod_id);
 
 	/*
 	 * Create a device id for the interface: