mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
gpu: host1x: NULL check before get_rate
Avoid calling get_rate function pointer when it is not supported by the client driver. Bug 4338396 Signed-off-by: Johnny Liu <johnliu@nvidia.com> Change-Id: Iee7f26865d82235de7a5b41347546c1195a7ea48 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000315 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
f2653ba797
commit
cbde6ba274
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
|
#include <linux/errno.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/host1x-next.h>
|
#include <linux/host1x-next.h>
|
||||||
|
|
||||||
@@ -191,6 +192,9 @@ static int host1x_actmon_module_avg_norm_get(void *data, u64 *val)
|
|||||||
unsigned long client_freq;
|
unsigned long client_freq;
|
||||||
u32 active_clks, client_clks;
|
u32 active_clks, client_clks;
|
||||||
|
|
||||||
|
if (!client->ops->get_rate)
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
active_clks = actmon_module_readl(module, HOST1X_ACTMON_MODULE_AVG_COUNT_REG);
|
active_clks = actmon_module_readl(module, HOST1X_ACTMON_MODULE_AVG_COUNT_REG);
|
||||||
|
|
||||||
client_freq = client->ops->get_rate(client);
|
client_freq = client->ops->get_rate(client);
|
||||||
|
|||||||
Reference in New Issue
Block a user