diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index 38d5a842..973adc7d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -775,12 +775,13 @@ void gk20a_remove_sysfs(struct device *dev) | |||
775 | 775 | ||
776 | if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) { | 776 | if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) { |
777 | sysfs_remove_link(&g->host1x_dev->dev.kobj, dev_name(dev)); | 777 | sysfs_remove_link(&g->host1x_dev->dev.kobj, dev_name(dev)); |
778 | if (strcmp(dev_name(dev), "gpu.0")) { | 778 | } |
779 | struct kobject *kobj = &dev->kobj; | 779 | |
780 | struct device *parent = container_of((kobj->parent), | 780 | if (strcmp(dev_name(dev), "gpu.0")) { |
781 | struct device, kobj); | 781 | struct kobject *kobj = &dev->kobj; |
782 | sysfs_remove_link(&parent->kobj, "gpu.0"); | 782 | struct device *parent = container_of((kobj->parent), |
783 | } | 783 | struct device, kobj); |
784 | sysfs_remove_link(&parent->kobj, "gpu.0"); | ||
784 | } | 785 | } |
785 | } | 786 | } |
786 | 787 | ||
@@ -816,14 +817,14 @@ void gk20a_create_sysfs(struct device *dev) | |||
816 | error |= sysfs_create_link(&g->host1x_dev->dev.kobj, | 817 | error |= sysfs_create_link(&g->host1x_dev->dev.kobj, |
817 | &dev->kobj, | 818 | &dev->kobj, |
818 | dev_name(dev)); | 819 | dev_name(dev)); |
819 | if (strcmp(dev_name(dev), "gpu.0")) { | 820 | } |
820 | struct kobject *kobj = &dev->kobj; | ||
821 | struct device *parent = container_of((kobj->parent), | ||
822 | struct device, kobj); | ||
823 | error |= sysfs_create_link(&parent->kobj, | ||
824 | &dev->kobj, "gpu.0"); | ||
825 | } | ||
826 | 821 | ||
822 | if (strcmp(dev_name(dev), "gpu.0")) { | ||
823 | struct kobject *kobj = &dev->kobj; | ||
824 | struct device *parent = container_of((kobj->parent), | ||
825 | struct device, kobj); | ||
826 | error |= sysfs_create_link(&parent->kobj, | ||
827 | &dev->kobj, "gpu.0"); | ||
827 | } | 828 | } |
828 | 829 | ||
829 | if (error) | 830 | if (error) |