Commit c9733b78 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

greybus: firmware: Fix incorrect firmware file's name



All the id-fields are 32 bit long instead of 16 bits and so we will need
8 characters per field instead of four. Also the stage field is only one
byte long and so needs just two characters to represent it.

Reported-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 8bcc2d80
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ static int download_firmware(struct gb_firmware *firmware, u8 stage)
{
	struct gb_connection *connection = firmware->connection;
	struct gb_interface *intf = connection->bundle->intf;
	char firmware_name[32];
	char firmware_name[46];

	/* Already have a firmware, free it */
	if (firmware->fw)
@@ -39,7 +39,7 @@ static int download_firmware(struct gb_firmware *firmware, u8 stage)
	 * XXX Name it properly..
	 */
	snprintf(firmware_name, sizeof(firmware_name),
		 "ara:%04x:%04x:%04x:%04x:%04x.fw",
		 "ara:%08x:%08x:%08x:%08x:%02x.fw",
		 intf->unipro_mfg_id, intf->unipro_prod_id,
		 intf->ara_vend_id, intf->ara_prod_id, stage);