]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: move all firmware prefix strings to one place
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 20 Jul 2016 17:11:37 +0000 (10:11 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 20 Jul 2016 17:29:07 +0000 (10:29 -0700)
The firmware prefix is hard-coded in a few different places.  Put it all
in one handy #define, for when/if we ever decide to change it in the
future...

Testing: 'strings gb-firmware.ko gb-bootrom.ko | grep ara_' produced the
 same output before and after this patch.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Sandeep Patil <sspatil@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/bootrom.c
drivers/staging/greybus/firmware.h
drivers/staging/greybus/fw-download.c

index 688184181e0c193fcc742fd8c0e62e3b05285729..309e0a7c865a69db0ab634179984fd87f26f26d3 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/workqueue.h>
 
 #include "greybus.h"
+#include "firmware.h"
 
 /* Timeout, in jiffies, within which the next request must be received */
 #define NEXT_REQ_TIMEOUT_MS    1000
@@ -157,7 +158,7 @@ static int download_firmware(struct gb_bootrom *bootrom, u8 stage)
         * XXX Name it properly..
         */
        snprintf(firmware_name, sizeof(firmware_name),
-                "ara_%08x_%08x_%08x_%08x_s2l.tftf",
+                FW_NAME_PREFIX "%08x_%08x_%08x_%08x_s2l.tftf",
                 intf->ddbl1_manufacturer_id, intf->ddbl1_product_id,
                 intf->vendor_id, intf->product_id);
 
index fb955379cfe46e7b639fcdd8e14b0914f1cbd6a9..2fbb263895d2cbaf708ab3ee1d746dbb18c998f0 100644 (file)
 
 #include "greybus.h"
 
+#define FW_NAME_PREFIX "ara_"
+
+/* Length of the string in format: "FW_NAME_PREFIX""%08x_%08x_%08x_%08x_%s.tftf" */
+#define FW_NAME_LEN            56
+
 /* Firmware Management Protocol specific functions */
 int fw_mgmt_init(void);
 void fw_mgmt_exit(void);
index 42cbbf4ac0773c139f781cad2d95711450396a4d..41a45ecb62b65dd4bf65955e91bfb2a3e31d1007 100644 (file)
@@ -14,8 +14,6 @@
 #include "firmware.h"
 #include "greybus.h"
 
-/* Length of the string in format: ara_%08x_%08x_%08x_%08x_%s.tftf */
-#define FW_NAME_LEN            56
 /* Estimated minimum buffer size, actual size can be smaller than this */
 #define MIN_FETCH_SIZE         512
 /* Timeout, in jiffies, within which fetch or release firmware must be called */
@@ -182,7 +180,7 @@ static struct fw_request *find_firmware(struct fw_download *fw_download,
        fw_req->firmware_id = ret;
 
        snprintf(fw_req->name, sizeof(fw_req->name),
-                "ara_%08x_%08x_%08x_%08x_%s.tftf",
+                FW_NAME_PREFIX "%08x_%08x_%08x_%08x_%s.tftf",
                 intf->ddbl1_manufacturer_id, intf->ddbl1_product_id,
                 intf->vendor_id, intf->product_id, tag);