aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/cpqphp_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_sysfs.c')
-rw-r--r--drivers/pci/hotplug/cpqphp_sysfs.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index 4cb30447a486..17c1f36315d1 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -167,26 +167,8 @@ exit:
167 167
168static loff_t lseek(struct file *file, loff_t off, int whence) 168static loff_t lseek(struct file *file, loff_t off, int whence)
169{ 169{
170 struct ctrl_dbg *dbg; 170 struct ctrl_dbg *dbg = file->private_data;
171 loff_t new = -1; 171 return fixed_size_llseek(file, off, whence, dbg->size);
172
173 mutex_lock(&cpqphp_mutex);
174 dbg = file->private_data;
175
176 switch (whence) {
177 case 0:
178 new = off;
179 break;
180 case 1:
181 new = file->f_pos + off;
182 break;
183 }
184 if (new < 0 || new > dbg->size) {
185 mutex_unlock(&cpqphp_mutex);
186 return -EINVAL;
187 }
188 mutex_unlock(&cpqphp_mutex);
189 return (file->f_pos = new);
190} 172}
191 173
192static ssize_t read(struct file *file, char __user *buf, 174static ssize_t read(struct file *file, char __user *buf,