aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/atom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/atom.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/atom.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index d1444aaca038..81c60a277eeb 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1300,8 +1300,7 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
1300 struct atom_context *ctx = 1300 struct atom_context *ctx =
1301 kzalloc(sizeof(struct atom_context), GFP_KERNEL); 1301 kzalloc(sizeof(struct atom_context), GFP_KERNEL);
1302 char *str; 1302 char *str;
1303 char name[512]; 1303 u16 idx;
1304 int i;
1305 1304
1306 if (!ctx) 1305 if (!ctx)
1307 return NULL; 1306 return NULL;
@@ -1339,18 +1338,13 @@ struct atom_context *amdgpu_atom_parse(struct card_info *card, void *bios)
1339 return NULL; 1338 return NULL;
1340 } 1339 }
1341 1340
1342 str = CSTR(CU16(base + ATOM_ROM_MSG_PTR)); 1341 idx = CU16(ATOM_ROM_PART_NUMBER_PTR);
1343 while (*str && ((*str == '\n') || (*str == '\r'))) 1342 if (idx == 0)
1344 str++; 1343 idx = 0x80;
1345 /* name string isn't always 0 terminated */ 1344
1346 for (i = 0; i < 511; i++) { 1345 str = CSTR(idx);
1347 name[i] = str[i]; 1346 if (*str != '\0')
1348 if (name[i] < '.' || name[i] > 'z') { 1347 pr_info("ATOM BIOS: %s\n", str);
1349 name[i] = 0;
1350 break;
1351 }
1352 }
1353 pr_info("ATOM BIOS: %s\n", name);
1354 1348
1355 return ctx; 1349 return ctx;
1356} 1350}