diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index f7e0a2b6..9ebc5bab 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -333,6 +333,8 @@ static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store); | |||
333 | 333 | ||
334 | void gk20a_remove_sysfs(struct device *dev) | 334 | void gk20a_remove_sysfs(struct device *dev) |
335 | { | 335 | { |
336 | struct gk20a *g = get_gk20a(to_platform_device(dev)); | ||
337 | |||
336 | device_remove_file(dev, &dev_attr_elcg_enable); | 338 | device_remove_file(dev, &dev_attr_elcg_enable); |
337 | device_remove_file(dev, &dev_attr_blcg_enable); | 339 | device_remove_file(dev, &dev_attr_blcg_enable); |
338 | device_remove_file(dev, &dev_attr_slcg_enable); | 340 | device_remove_file(dev, &dev_attr_slcg_enable); |
@@ -343,10 +345,14 @@ void gk20a_remove_sysfs(struct device *dev) | |||
343 | device_remove_file(dev, &dev_attr_load); | 345 | device_remove_file(dev, &dev_attr_load); |
344 | device_remove_file(dev, &dev_attr_railgate_delay); | 346 | device_remove_file(dev, &dev_attr_railgate_delay); |
345 | device_remove_file(dev, &dev_attr_clockgate_delay); | 347 | device_remove_file(dev, &dev_attr_clockgate_delay); |
348 | |||
349 | if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) | ||
350 | sysfs_remove_link(&dev->kobj, dev_name(dev)); | ||
346 | } | 351 | } |
347 | 352 | ||
348 | void gk20a_create_sysfs(struct platform_device *dev) | 353 | void gk20a_create_sysfs(struct platform_device *dev) |
349 | { | 354 | { |
355 | struct gk20a *g = get_gk20a(dev); | ||
350 | int error = 0; | 356 | int error = 0; |
351 | 357 | ||
352 | error |= device_create_file(&dev->dev, &dev_attr_elcg_enable); | 358 | error |= device_create_file(&dev->dev, &dev_attr_elcg_enable); |
@@ -360,6 +366,12 @@ void gk20a_create_sysfs(struct platform_device *dev) | |||
360 | error |= device_create_file(&dev->dev, &dev_attr_railgate_delay); | 366 | error |= device_create_file(&dev->dev, &dev_attr_railgate_delay); |
361 | error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay); | 367 | error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay); |
362 | 368 | ||
369 | if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) | ||
370 | error |= sysfs_create_link(&g->host1x_dev->dev.kobj, | ||
371 | &dev->dev.kobj, | ||
372 | dev_name(&dev->dev)); | ||
373 | |||
363 | if (error) | 374 | if (error) |
364 | dev_err(&dev->dev, "Failed to create sysfs attributes!\n"); | 375 | dev_err(&dev->dev, "Failed to create sysfs attributes!\n"); |
376 | |||
365 | } | 377 | } |