cpufreq: Move ->get callback check outside of __cpufreq_get()
authorYue Hu <huyue2@yulong.com>
Fri, 19 Apr 2019 06:27:58 +0000 (14:27 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 23 Apr 2019 08:58:43 +0000 (10:58 +0200)
commit4db7c34cb41a3d7ed7db7a84413d7c225278c36a
tree66506ba7044078b2246d76ade741c63b0041cdb5
parentb23aa311fa1f376640069e5da897b4a6148d104f
cpufreq: Move ->get callback check outside of __cpufreq_get()

Currenly, __cpufreq_get() called by show_cpuinfo_cur_freq() will check
->get callback. That is needless since cpuinfo_cur_freq attribute will
not be created if ->get is not set. So let's drop it in __cpufreq_get().
Also keep this check in cpufreq_get().

Signed-off-by: Yue Hu <huyue2@yulong.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c