diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c index 800f39c3..5035bb99 100644 --- a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c +++ b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | |||
@@ -20,11 +20,10 @@ | |||
20 | 20 | ||
21 | #define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) | 21 | #define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) |
22 | 22 | ||
23 | static ssize_t ecc_enable_store(struct device *device, | 23 | static ssize_t ecc_enable_store(struct device *dev, |
24 | struct device_attribute *attr, const char *buf, size_t count) | 24 | struct device_attribute *attr, const char *buf, size_t count) |
25 | { | 25 | { |
26 | struct platform_device *ndev = to_platform_device(device); | 26 | struct gk20a *g = get_gk20a(dev); |
27 | struct gk20a *g = get_gk20a(ndev); | ||
28 | u32 ecc_mask; | 27 | u32 ecc_mask; |
29 | u32 err = 0; | 28 | u32 err = 0; |
30 | 29 | ||
@@ -33,17 +32,16 @@ static ssize_t ecc_enable_store(struct device *device, | |||
33 | err = g->ops.pmu.send_lrf_tex_ltc_dram_overide_en_dis_cmd | 32 | err = g->ops.pmu.send_lrf_tex_ltc_dram_overide_en_dis_cmd |
34 | (g, ecc_mask); | 33 | (g, ecc_mask); |
35 | if (err) | 34 | if (err) |
36 | dev_err(device, "ECC override did not happen\n"); | 35 | dev_err(dev, "ECC override did not happen\n"); |
37 | } else | 36 | } else |
38 | return -EINVAL; | 37 | return -EINVAL; |
39 | return count; | 38 | return count; |
40 | } | 39 | } |
41 | 40 | ||
42 | static ssize_t ecc_enable_read(struct device *device, | 41 | static ssize_t ecc_enable_read(struct device *dev, |
43 | struct device_attribute *attr, char *buf) | 42 | struct device_attribute *attr, char *buf) |
44 | { | 43 | { |
45 | struct platform_device *ndev = to_platform_device(device); | 44 | struct gk20a *g = get_gk20a(dev); |
46 | struct gk20a *g = get_gk20a(ndev); | ||
47 | 45 | ||
48 | return sprintf(buf, "ecc override =0x%x\n", | 46 | return sprintf(buf, "ecc override =0x%x\n", |
49 | g->ops.gr.get_lrf_tex_ltc_dram_override(g)); | 47 | g->ops.gr.get_lrf_tex_ltc_dram_override(g)); |
@@ -51,13 +49,13 @@ static ssize_t ecc_enable_read(struct device *device, | |||
51 | 49 | ||
52 | static DEVICE_ATTR(ecc_enable, ROOTRW, ecc_enable_read, ecc_enable_store); | 50 | static DEVICE_ATTR(ecc_enable, ROOTRW, ecc_enable_read, ecc_enable_store); |
53 | 51 | ||
54 | void gp10b_create_sysfs(struct platform_device *dev) | 52 | void gp10b_create_sysfs(struct device *dev) |
55 | { | 53 | { |
56 | int error = 0; | 54 | int error = 0; |
57 | 55 | ||
58 | error |= device_create_file(&dev->dev, &dev_attr_ecc_enable); | 56 | error |= device_create_file(dev, &dev_attr_ecc_enable); |
59 | if (error) | 57 | if (error) |
60 | dev_err(&dev->dev, "Failed to create sysfs attributes!\n"); | 58 | dev_err(dev, "Failed to create sysfs attributes!\n"); |
61 | } | 59 | } |
62 | 60 | ||
63 | void gp10b_remove_sysfs(struct device *dev) | 61 | void gp10b_remove_sysfs(struct device *dev) |