summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
index 1065968b..4a79a142 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c
@@ -28,6 +28,7 @@
28#endif 28#endif
29 29
30#include <nvgpu/kmem.h> 30#include <nvgpu/kmem.h>
31#include <nvgpu/nvhost.h>
31 32
32#include "gk20a.h" 33#include "gk20a.h"
33#include "gk20a/platform_gk20a.h" 34#include "gk20a/platform_gk20a.h"
@@ -889,8 +890,6 @@ static DEVICE_ATTR(max_timeslice_us, ROOTRW, max_timeslice_us_read,
889 890
890void gk20a_remove_sysfs(struct device *dev) 891void gk20a_remove_sysfs(struct device *dev)
891{ 892{
892 struct gk20a *g = get_gk20a(dev);
893
894 device_remove_file(dev, &dev_attr_elcg_enable); 893 device_remove_file(dev, &dev_attr_elcg_enable);
895 device_remove_file(dev, &dev_attr_blcg_enable); 894 device_remove_file(dev, &dev_attr_blcg_enable);
896 device_remove_file(dev, &dev_attr_slcg_enable); 895 device_remove_file(dev, &dev_attr_slcg_enable);
@@ -917,9 +916,9 @@ void gk20a_remove_sysfs(struct device *dev)
917 device_remove_file(dev, &dev_attr_min_timeslice_us); 916 device_remove_file(dev, &dev_attr_min_timeslice_us);
918 device_remove_file(dev, &dev_attr_max_timeslice_us); 917 device_remove_file(dev, &dev_attr_max_timeslice_us);
919 918
920 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) { 919#ifdef CONFIG_TEGRA_GK20A_NVHOST
921 sysfs_remove_link(&g->host1x_dev->dev.kobj, dev_name(dev)); 920 nvgpu_nvhost_remove_symlink(get_gk20a(dev));
922 } 921#endif
923 922
924 if (strcmp(dev_name(dev), "gpu.0")) { 923 if (strcmp(dev_name(dev), "gpu.0")) {
925 struct kobject *kobj = &dev->kobj; 924 struct kobject *kobj = &dev->kobj;
@@ -931,7 +930,6 @@ void gk20a_remove_sysfs(struct device *dev)
931 930
932void gk20a_create_sysfs(struct device *dev) 931void gk20a_create_sysfs(struct device *dev)
933{ 932{
934 struct gk20a *g = gk20a_from_dev(dev);
935 int error = 0; 933 int error = 0;
936 934
937 error |= device_create_file(dev, &dev_attr_elcg_enable); 935 error |= device_create_file(dev, &dev_attr_elcg_enable);
@@ -960,11 +958,9 @@ void gk20a_create_sysfs(struct device *dev)
960 error |= device_create_file(dev, &dev_attr_min_timeslice_us); 958 error |= device_create_file(dev, &dev_attr_min_timeslice_us);
961 error |= device_create_file(dev, &dev_attr_max_timeslice_us); 959 error |= device_create_file(dev, &dev_attr_max_timeslice_us);
962 960
963 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) { 961#ifdef CONFIG_TEGRA_GK20A_NVHOST
964 error |= sysfs_create_link(&g->host1x_dev->dev.kobj, 962 error |= nvgpu_nvhost_create_symlink(get_gk20a(dev));
965 &dev->kobj, 963#endif
966 dev_name(dev));
967 }
968 964
969 if (strcmp(dev_name(dev), "gpu.0")) { 965 if (strcmp(dev_name(dev), "gpu.0")) {
970 struct kobject *kobj = &dev->kobj; 966 struct kobject *kobj = &dev->kobj;