summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorSzuying Chen <Chloe_Chen@asmedia.com.tw>2022-09-02 11:40:09 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2022-09-07 08:06:50 +0200
commit5424e1bf16f96bd681c780f5fd12e33588c7ade3 (patch)
tree04f672c3c52001e3fb013d19335d4a7bc2ed4c09 /drivers/thunderbolt
parentthunderbolt: Allow NVM upgrade of USB4 host routers (diff)
downloadlinux-5424e1bf16f96bd681c780f5fd12e33588c7ade3.tar.xz
linux-5424e1bf16f96bd681c780f5fd12e33588c7ade3.zip
thunderbolt: Extend NVM version fields to 32-bits
In order to support non-Intel NVM image formats extend the NVM major and minor version to 32-bits to better accommondate different versioning schemes. No functional impact. Signed-off-by: Szuying Chen <Chloe_Chen@asmedia.com.tw> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/retimer.c4
-rw-r--r--drivers/thunderbolt/switch.c4
-rw-r--r--drivers/thunderbolt/tb.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index 8c29bd556ae0..dc0fc90e81cf 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -71,8 +71,8 @@ static int tb_retimer_nvm_add(struct tb_retimer *rt)
if (ret)
goto err_nvm;
- nvm->major = val >> 16;
- nvm->minor = val >> 8;
+ nvm->major = (val >> 16) & 0xff;
+ nvm->minor = (val >> 8) & 0xff;
ret = usb4_port_retimer_nvm_read(rt->port, rt->index, NVM_FLASH_SIZE,
&val, sizeof(val));
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index bd815e2cc6ec..ac8d7145e9ff 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -427,8 +427,8 @@ static int tb_switch_nvm_add(struct tb_switch *sw)
if (ret)
goto err_nvm;
- nvm->major = val >> 16;
- nvm->minor = val >> 8;
+ nvm->major = (val >> 16) & 0xff;
+ nvm->minor = (val >> 8) & 0xff;
ret = tb_nvm_add_active(nvm, nvm_size, tb_switch_nvm_read);
if (ret)
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index 87aefac03d8a..f8fbab1b49ec 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -48,8 +48,8 @@
*/
struct tb_nvm {
struct device *dev;
- u8 major;
- u8 minor;
+ u32 major;
+ u32 minor;
int id;
struct nvmem_device *active;
struct nvmem_device *non_active;