summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--overlay/gpu-freq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/overlay/gpu-freq.c b/overlay/gpu-freq.c
index a2d8f084..321c9388 100644
--- a/overlay/gpu-freq.c
+++ b/overlay/gpu-freq.c
@@ -91,11 +91,14 @@ int gpu_freq_init(struct gpu_freq *gf)
if (strstr(buf, "PUNIT_REG_GPU_FREQ_STS")) {
/* Baytrail is special, ofc. */
gf->is_byt = 1;
+
s = strstr(buf, "max");
- if (s == NULL)
- goto err;
- sscanf(s, "max GPU freq: %d MHz", &gf->max);
- sscanf(s, "min GPU freq: %d MHz", &gf->min);
+ if (s != NULL)
+ sscanf(s, "max GPU freq: %d MHz", &gf->max);
+
+ s = strstr(buf, "min");
+ if (s != NULL)
+ sscanf(s, "min GPU freq: %d MHz", &gf->min);
gf->rp0 = gf->rp1 = gf->max;
gf->rpn = gf->min;