aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /drivers/media
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c5
-rw-r--r--drivers/media/dvb-core/dvb_net.c5
-rw-r--r--drivers/media/pci/cx25821/cx25821-audio-upstream.c179
-rw-r--r--drivers/media/pci/ttpci/av7110_ir.c2
-rw-r--r--drivers/media/pci/zoran/zoran_procfs.c4
-rw-r--r--drivers/media/rc/ir-lirc-codec.c2
-rw-r--r--drivers/media/rc/lirc_dev.c2
7 files changed, 60 insertions, 139 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 57601c0704c1..1f925e856974 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2527,11 +2527,8 @@ static int dvb_frontend_release(struct inode *inode, struct file *file)
2527 2527
2528 if (dvbdev->users == -1) { 2528 if (dvbdev->users == -1) {
2529 wake_up(&fepriv->wait_queue); 2529 wake_up(&fepriv->wait_queue);
2530 if (fepriv->exit != DVB_FE_NO_EXIT) { 2530 if (fepriv->exit != DVB_FE_NO_EXIT)
2531 fops_put(file->f_op);
2532 file->f_op = NULL;
2533 wake_up(&dvbdev->wait_queue); 2531 wake_up(&dvbdev->wait_queue);
2534 }
2535 if (fe->ops.ts_bus_ctrl) 2532 if (fe->ops.ts_bus_ctrl)
2536 fe->ops.ts_bus_ctrl(fe, 0); 2533 fe->ops.ts_bus_ctrl(fe, 0);
2537 } 2534 }
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index c3cc3b52662b..f91c80c0e9ec 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -1479,11 +1479,8 @@ static int dvb_net_close(struct inode *inode, struct file *file)
1479 1479
1480 dvb_generic_release(inode, file); 1480 dvb_generic_release(inode, file);
1481 1481
1482 if(dvbdev->users == 1 && dvbnet->exit == 1) { 1482 if(dvbdev->users == 1 && dvbnet->exit == 1)
1483 fops_put(file->f_op);
1484 file->f_op = NULL;
1485 wake_up(&dvbdev->wait_queue); 1483 wake_up(&dvbdev->wait_queue);
1486 }
1487 return 0; 1484 return 0;
1488} 1485}
1489 1486
diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
index b9be535e32b8..68dbc2dbc982 100644
--- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
@@ -259,79 +259,46 @@ void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev)
259static int cx25821_get_audio_data(struct cx25821_dev *dev, 259static int cx25821_get_audio_data(struct cx25821_dev *dev,
260 const struct sram_channel *sram_ch) 260 const struct sram_channel *sram_ch)
261{ 261{
262 struct file *myfile; 262 struct file *file;
263 int frame_index_temp = dev->_audioframe_index; 263 int frame_index_temp = dev->_audioframe_index;
264 int i = 0; 264 int i = 0;
265 int line_size = AUDIO_LINE_SIZE;
266 int frame_size = AUDIO_DATA_BUF_SZ; 265 int frame_size = AUDIO_DATA_BUF_SZ;
267 int frame_offset = frame_size * frame_index_temp; 266 int frame_offset = frame_size * frame_index_temp;
268 ssize_t vfs_read_retval = 0; 267 char mybuf[AUDIO_LINE_SIZE];
269 char mybuf[line_size];
270 loff_t file_offset = dev->_audioframe_count * frame_size; 268 loff_t file_offset = dev->_audioframe_count * frame_size;
271 loff_t pos; 269 char *p = NULL;
272 mm_segment_t old_fs;
273 270
274 if (dev->_audiofile_status == END_OF_FILE) 271 if (dev->_audiofile_status == END_OF_FILE)
275 return 0; 272 return 0;
276 273
277 myfile = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0); 274 file = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0);
275 if (IS_ERR(file)) {
276 pr_err("%s(): ERROR opening file(%s) with errno = %ld!\n",
277 __func__, dev->_audiofilename, -PTR_ERR(file));
278 return PTR_ERR(file);
279 }
278 280
279 if (IS_ERR(myfile)) { 281 if (dev->_audiodata_buf_virt_addr)
280 const int open_errno = -PTR_ERR(myfile); 282 p = (char *)dev->_audiodata_buf_virt_addr + frame_offset;
281 pr_err("%s(): ERROR opening file(%s) with errno = %d!\n",
282 __func__, dev->_audiofilename, open_errno);
283 return PTR_ERR(myfile);
284 } else {
285 if (!(myfile->f_op)) {
286 pr_err("%s(): File has no file operations registered!\n",
287 __func__);
288 filp_close(myfile, NULL);
289 return -EIO;
290 }
291 283
292 if (!myfile->f_op->read) { 284 for (i = 0; i < dev->_audio_lines_count; i++) {
293 pr_err("%s(): File has no READ operations registered!\n", 285 int n = kernel_read(file, file_offset, mybuf, AUDIO_LINE_SIZE);
286 if (n < AUDIO_LINE_SIZE) {
287 pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
294 __func__); 288 __func__);
295 filp_close(myfile, NULL); 289 dev->_audiofile_status = END_OF_FILE;
296 return -EIO; 290 fput(file);
291 return 0;
297 } 292 }
298 293 dev->_audiofile_status = IN_PROGRESS;
299 pos = myfile->f_pos; 294 if (p) {
300 old_fs = get_fs(); 295 memcpy(p, mybuf, n);
301 set_fs(KERNEL_DS); 296 p += n;
302
303 for (i = 0; i < dev->_audio_lines_count; i++) {
304 pos = file_offset;
305
306 vfs_read_retval = vfs_read(myfile, mybuf, line_size,
307 &pos);
308
309 if (vfs_read_retval > 0 && vfs_read_retval == line_size
310 && dev->_audiodata_buf_virt_addr != NULL) {
311 memcpy((void *)(dev->_audiodata_buf_virt_addr +
312 frame_offset / 4), mybuf,
313 vfs_read_retval);
314 }
315
316 file_offset += vfs_read_retval;
317 frame_offset += vfs_read_retval;
318
319 if (vfs_read_retval < line_size) {
320 pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
321 __func__);
322 break;
323 }
324 } 297 }
325 298 file_offset += n;
326 if (i > 0)
327 dev->_audioframe_count++;
328
329 dev->_audiofile_status = (vfs_read_retval == line_size) ?
330 IN_PROGRESS : END_OF_FILE;
331
332 set_fs(old_fs);
333 filp_close(myfile, NULL);
334 } 299 }
300 dev->_audioframe_count++;
301 fput(file);
335 302
336 return 0; 303 return 0;
337} 304}
@@ -354,81 +321,41 @@ static void cx25821_audioups_handler(struct work_struct *work)
354static int cx25821_openfile_audio(struct cx25821_dev *dev, 321static int cx25821_openfile_audio(struct cx25821_dev *dev,
355 const struct sram_channel *sram_ch) 322 const struct sram_channel *sram_ch)
356{ 323{
357 struct file *myfile; 324 char *p = (void *)dev->_audiodata_buf_virt_addr;
358 int i = 0, j = 0; 325 struct file *file;
359 int line_size = AUDIO_LINE_SIZE; 326 loff_t offset;
360 ssize_t vfs_read_retval = 0; 327 int i, j;
361 char mybuf[line_size]; 328
362 loff_t pos; 329 file = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0);
363 loff_t offset = (unsigned long)0; 330 if (IS_ERR(file)) {
364 mm_segment_t old_fs; 331 pr_err("%s(): ERROR opening file(%s) with errno = %ld!\n",
365 332 __func__, dev->_audiofilename, PTR_ERR(file));
366 myfile = filp_open(dev->_audiofilename, O_RDONLY | O_LARGEFILE, 0); 333 return PTR_ERR(file);
367 334 }
368 if (IS_ERR(myfile)) {
369 const int open_errno = -PTR_ERR(myfile);
370 pr_err("%s(): ERROR opening file(%s) with errno = %d!\n",
371 __func__, dev->_audiofilename, open_errno);
372 return PTR_ERR(myfile);
373 } else {
374 if (!(myfile->f_op)) {
375 pr_err("%s(): File has no file operations registered!\n",
376 __func__);
377 filp_close(myfile, NULL);
378 return -EIO;
379 }
380
381 if (!myfile->f_op->read) {
382 pr_err("%s(): File has no READ operations registered!\n",
383 __func__);
384 filp_close(myfile, NULL);
385 return -EIO;
386 }
387
388 pos = myfile->f_pos;
389 old_fs = get_fs();
390 set_fs(KERNEL_DS);
391
392 for (j = 0; j < NUM_AUDIO_FRAMES; j++) {
393 for (i = 0; i < dev->_audio_lines_count; i++) {
394 pos = offset;
395
396 vfs_read_retval = vfs_read(myfile, mybuf,
397 line_size, &pos);
398
399 if (vfs_read_retval > 0 &&
400 vfs_read_retval == line_size &&
401 dev->_audiodata_buf_virt_addr != NULL) {
402 memcpy((void *)(dev->
403 _audiodata_buf_virt_addr
404 + offset / 4), mybuf,
405 vfs_read_retval);
406 }
407 335
408 offset += vfs_read_retval; 336 for (j = 0, offset = 0; j < NUM_AUDIO_FRAMES; j++) {
337 for (i = 0; i < dev->_audio_lines_count; i++) {
338 char buf[AUDIO_LINE_SIZE];
339 int n = kernel_read(file, offset, buf,
340 AUDIO_LINE_SIZE);
409 341
410 if (vfs_read_retval < line_size) { 342 if (n < AUDIO_LINE_SIZE) {
411 pr_info("Done: exit %s() since no more bytes to read from Audio file\n", 343 pr_info("Done: exit %s() since no more bytes to read from Audio file\n",
412 __func__); 344 __func__);
413 break; 345 dev->_audiofile_status = END_OF_FILE;
414 } 346 fput(file);
347 return 0;
415 } 348 }
416 349
417 if (i > 0) 350 if (p)
418 dev->_audioframe_count++; 351 memcpy(p + offset, buf, n);
419 352
420 if (vfs_read_retval < line_size) 353 offset += n;
421 break;
422 } 354 }
423 355 dev->_audioframe_count++;
424 dev->_audiofile_status = (vfs_read_retval == line_size) ?
425 IN_PROGRESS : END_OF_FILE;
426
427 set_fs(old_fs);
428 myfile->f_pos = 0;
429 filp_close(myfile, NULL);
430 } 356 }
431 357 dev->_audiofile_status = IN_PROGRESS;
358 fput(file);
432 return 0; 359 return 0;
433} 360}
434 361
diff --git a/drivers/media/pci/ttpci/av7110_ir.c b/drivers/media/pci/ttpci/av7110_ir.c
index eb822862a646..0e763a784e2b 100644
--- a/drivers/media/pci/ttpci/av7110_ir.c
+++ b/drivers/media/pci/ttpci/av7110_ir.c
@@ -375,7 +375,7 @@ int av7110_ir_init(struct av7110 *av7110)
375 if (av_cnt == 1) { 375 if (av_cnt == 1) {
376 e = proc_create("av7110_ir", S_IWUSR, NULL, &av7110_ir_proc_fops); 376 e = proc_create("av7110_ir", S_IWUSR, NULL, &av7110_ir_proc_fops);
377 if (e) 377 if (e)
378 e->size = 4 + 256 * sizeof(u16); 378 proc_set_size(e, 4 + 256 * sizeof(u16));
379 } 379 }
380 380
381 tasklet_init(&av7110->ir.ir_tasklet, av7110_emit_key, (unsigned long) &av7110->ir); 381 tasklet_init(&av7110->ir.ir_tasklet, av7110_emit_key, (unsigned long) &av7110->ir);
diff --git a/drivers/media/pci/zoran/zoran_procfs.c b/drivers/media/pci/zoran/zoran_procfs.c
index 1512b5d40533..f7ceee0cdefd 100644
--- a/drivers/media/pci/zoran/zoran_procfs.c
+++ b/drivers/media/pci/zoran/zoran_procfs.c
@@ -130,14 +130,14 @@ static int zoran_show(struct seq_file *p, void *v)
130 130
131static int zoran_open(struct inode *inode, struct file *file) 131static int zoran_open(struct inode *inode, struct file *file)
132{ 132{
133 struct zoran *data = PDE(inode)->data; 133 struct zoran *data = PDE_DATA(inode);
134 return single_open(file, zoran_show, data); 134 return single_open(file, zoran_show, data);
135} 135}
136 136
137static ssize_t zoran_write(struct file *file, const char __user *buffer, 137static ssize_t zoran_write(struct file *file, const char __user *buffer,
138 size_t count, loff_t *ppos) 138 size_t count, loff_t *ppos)
139{ 139{
140 struct zoran *zr = PDE(file_inode(file))->data; 140 struct zoran *zr = PDE_DATA(file_inode(file));
141 char *string, *sp; 141 char *string, *sp;
142 char *line, *ldelim, *varname, *svar, *tdelim; 142 char *line, *ldelim, *varname, *svar, *tdelim;
143 143
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index ff4d93d1907f..e4561264e124 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -307,7 +307,7 @@ static void ir_lirc_close(void *data)
307 return; 307 return;
308} 308}
309 309
310static struct file_operations lirc_fops = { 310static const struct file_operations lirc_fops = {
311 .owner = THIS_MODULE, 311 .owner = THIS_MODULE,
312 .write = ir_lirc_transmit_ir, 312 .write = ir_lirc_transmit_ir,
313 .unlocked_ioctl = ir_lirc_ioctl, 313 .unlocked_ioctl = ir_lirc_ioctl,
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 5247d94fea29..8dc057b273f2 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -152,7 +152,7 @@ static int lirc_thread(void *irctl)
152} 152}
153 153
154 154
155static struct file_operations lirc_dev_fops = { 155static const struct file_operations lirc_dev_fops = {
156 .owner = THIS_MODULE, 156 .owner = THIS_MODULE,
157 .read = lirc_dev_fop_read, 157 .read = lirc_dev_fop_read,
158 .write = lirc_dev_fop_write, 158 .write = lirc_dev_fop_write,