Merge tag 'gvt-fixes-2021-07-15' of https://github.com/intel/gvt-linux into drm-intel...
[linux-2.6-microblaze.git] / drivers / devfreq / governor.h
index 70f44b3..2d69a0c 100644 (file)
@@ -57,8 +57,6 @@
  *                     Basically, get_target_freq will run
  *                     devfreq_dev_profile.get_dev_status() to get the
  *                     status of the device (load = busy_time / total_time).
- *                     If no_central_polling is set, this callback is called
- *                     only with update_devfreq() notified by OPP.
  * @event_handler:      Callback for devfreq core framework to notify events
  *                      to governors. Events include per device governor
  *                      init and exit, opp changes out of devfreq, suspend
@@ -91,6 +89,9 @@ int devfreq_update_target(struct devfreq *devfreq, unsigned long freq);
 
 static inline int devfreq_update_stats(struct devfreq *df)
 {
+       if (!df->profile->get_dev_status)
+               return -EINVAL;
+
        return df->profile->get_dev_status(df->dev.parent, &df->last_status);
 }
 #endif /* _GOVERNOR_H */