.. | .. |
---|
115 | 115 | * @client: i2c client used to perform IO operations |
---|
116 | 116 | * |
---|
117 | 117 | * @ee_file: EEPROM read/write sysfs-file |
---|
118 | | - * @csr_file: CSR read/write debugfs-node |
---|
119 | 118 | */ |
---|
120 | 119 | struct idt_smb_seq; |
---|
121 | 120 | struct idt_89hpesx_dev { |
---|
.. | .. |
---|
137 | 136 | |
---|
138 | 137 | struct bin_attribute *ee_file; |
---|
139 | 138 | struct dentry *csr_dir; |
---|
140 | | - struct dentry *csr_file; |
---|
141 | 139 | }; |
---|
142 | 140 | |
---|
143 | 141 | /* |
---|
.. | .. |
---|
942 | 940 | u32 csraddr, csrval; |
---|
943 | 941 | char *buf; |
---|
944 | 942 | |
---|
| 943 | + if (*offp) |
---|
| 944 | + return 0; |
---|
| 945 | + |
---|
945 | 946 | /* Copy data from User-space */ |
---|
946 | 947 | buf = kmalloc(count + 1, GFP_KERNEL); |
---|
947 | 948 | if (!buf) |
---|
948 | 949 | return -ENOMEM; |
---|
949 | 950 | |
---|
950 | | - ret = simple_write_to_buffer(buf, count, offp, ubuf, count); |
---|
951 | | - if (ret < 0) |
---|
| 951 | + if (copy_from_user(buf, ubuf, count)) { |
---|
| 952 | + ret = -EFAULT; |
---|
952 | 953 | goto free_buf; |
---|
| 954 | + } |
---|
953 | 955 | buf[count] = 0; |
---|
954 | 956 | |
---|
955 | 957 | /* Find position of colon in the buffer */ |
---|
.. | .. |
---|
1378 | 1380 | pdev->csr_dir = debugfs_create_dir(fname, csr_dbgdir); |
---|
1379 | 1381 | |
---|
1380 | 1382 | /* Create Debugfs file for CSR read/write operations */ |
---|
1381 | | - pdev->csr_file = debugfs_create_file(cli->name, 0600, |
---|
1382 | | - pdev->csr_dir, pdev, &csr_dbgfs_ops); |
---|
| 1383 | + debugfs_create_file(cli->name, 0600, pdev->csr_dir, pdev, |
---|
| 1384 | + &csr_dbgfs_ops); |
---|
1383 | 1385 | } |
---|
1384 | 1386 | |
---|
1385 | 1387 | /* |
---|