-/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
"qcom,enable-midframe-timer")) {
kgsl_midframe = kzalloc(
sizeof(struct kgsl_midframe_info), GFP_KERNEL);
- hrtimer_init(&kgsl_midframe->timer,
- CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- kgsl_midframe->timer.function =
- kgsl_pwrscale_midframe_timer;
- kgsl_midframe->device = device;
+ if (kgsl_midframe) {
+ hrtimer_init(&kgsl_midframe->timer,
+ CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ kgsl_midframe->timer.function =
+ kgsl_pwrscale_midframe_timer;
+ kgsl_midframe->device = device;
+ } else
+ KGSL_PWR_ERR(device,
+ "Failed to enable-midframe-timer feature\n");
}
/*