From b6ed2c6d96fc6c37830b1450921f080c47b4a7bc Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 29 Nov 2017 15:48:44 -0800 Subject: gpu: nvgpu: Fix build with Tegra DVFS disabled Avoid using Tegra DVFS APIs when it is not built in. This is done by protecting the code using Tegra DVFS with #ifdef. Change-Id: Ia50b77aba8a085f436891e522514bb2b5b717c4d Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1607583 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/sysfs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/nvgpu/common/linux/sysfs.c b/drivers/gpu/nvgpu/common/linux/sysfs.c index 053c1a12..9d2eab92 100644 --- a/drivers/gpu/nvgpu/common/linux/sysfs.c +++ b/drivers/gpu/nvgpu/common/linux/sysfs.c @@ -17,7 +17,9 @@ #include #include #include +#ifdef CONFIG_TEGRA_DVFS #include +#endif #include #include @@ -726,6 +728,7 @@ static ssize_t emc3d_ratio_read(struct device *dev, static DEVICE_ATTR(emc3d_ratio, ROOTRW, emc3d_ratio_read, emc3d_ratio_store); +#ifdef CONFIG_TEGRA_DVFS static ssize_t fmax_at_vmin_safe_read(struct device *dev, struct device_attribute *attr, char *buf) { @@ -739,6 +742,7 @@ static ssize_t fmax_at_vmin_safe_read(struct device *dev, } static DEVICE_ATTR(fmax_at_vmin_safe, S_IRUGO, fmax_at_vmin_safe_read, NULL); +#endif #ifdef CONFIG_PM static ssize_t force_idle_store(struct device *dev, @@ -1014,7 +1018,9 @@ void nvgpu_remove_sysfs(struct device *dev) device_remove_file(dev, &dev_attr_elpg_enable); device_remove_file(dev, &dev_attr_mscg_enable); device_remove_file(dev, &dev_attr_emc3d_ratio); +#ifdef CONFIG_TEGRA_DVFS device_remove_file(dev, &dev_attr_fmax_at_vmin_safe); +#endif device_remove_file(dev, &dev_attr_counters); device_remove_file(dev, &dev_attr_counters_reset); device_remove_file(dev, &dev_attr_load); @@ -1061,7 +1067,9 @@ int nvgpu_create_sysfs(struct device *dev) error |= device_create_file(dev, &dev_attr_elpg_enable); error |= device_create_file(dev, &dev_attr_mscg_enable); error |= device_create_file(dev, &dev_attr_emc3d_ratio); +#ifdef CONFIG_TEGRA_DVFS error |= device_create_file(dev, &dev_attr_fmax_at_vmin_safe); +#endif error |= device_create_file(dev, &dev_attr_counters); error |= device_create_file(dev, &dev_attr_counters_reset); error |= device_create_file(dev, &dev_attr_load); -- cgit v1.2.2