aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-02-14 15:08:37 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:01 -0400
commit5811cf99df2e3c102055be3ea77508e56c9f77c6 (patch)
tree75be74b5072280edadeee2c1f6c42f5e961c208c /drivers/media/video/cx18/cx18-ioctl.c
parent1a2670465ec94029e5df62e3decca9e2f7aea075 (diff)
V4L/DVB (10756): cx18: Slim down instance handling, build names from v4l2_device.name
Convert card instance handling to a lighter weight mechanism like ivtv. Also convert name strings and debug messages to use v4l2_device.name. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 5c8e9cb244f9..3277b3d3ceae 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -387,20 +387,17 @@ static int cx18_g_chip_ident(struct file *file, void *fh,
387static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg) 387static int cx18_cxc(struct cx18 *cx, unsigned int cmd, void *arg)
388{ 388{
389 struct v4l2_dbg_register *regs = arg; 389 struct v4l2_dbg_register *regs = arg;
390 unsigned long flags;
391 390
392 if (!capable(CAP_SYS_ADMIN)) 391 if (!capable(CAP_SYS_ADMIN))
393 return -EPERM; 392 return -EPERM;
394 if (regs->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE) 393 if (regs->reg >= CX18_MEM_OFFSET + CX18_MEM_SIZE)
395 return -EINVAL; 394 return -EINVAL;
396 395
397 spin_lock_irqsave(&cx18_cards_lock, flags);
398 regs->size = 4; 396 regs->size = 4;
399 if (cmd == VIDIOC_DBG_G_REGISTER) 397 if (cmd == VIDIOC_DBG_G_REGISTER)
400 regs->val = cx18_read_enc(cx, regs->reg); 398 regs->val = cx18_read_enc(cx, regs->reg);
401 else 399 else
402 cx18_write_enc(cx, regs->val, regs->reg); 400 cx18_write_enc(cx, regs->val, regs->reg);
403 spin_unlock_irqrestore(&cx18_cards_lock, flags);
404 return 0; 401 return 0;
405} 402}
406 403
@@ -847,7 +844,7 @@ static int cx18_log_status(struct file *file, void *fh)
847 int i; 844 int i;
848 845
849 CX18_INFO("================= START STATUS CARD #%d " 846 CX18_INFO("================= START STATUS CARD #%d "
850 "=================\n", cx->num); 847 "=================\n", cx->instance);
851 CX18_INFO("Version: %s Card: %s\n", CX18_VERSION, cx->card_name); 848 CX18_INFO("Version: %s Card: %s\n", CX18_VERSION, cx->card_name);
852 if (cx->hw_flags & CX18_HW_TVEEPROM) { 849 if (cx->hw_flags & CX18_HW_TVEEPROM) {
853 struct tveeprom tv; 850 struct tveeprom tv;
@@ -865,7 +862,7 @@ static int cx18_log_status(struct file *file, void *fh)
865 mutex_unlock(&cx->gpio_lock); 862 mutex_unlock(&cx->gpio_lock);
866 CX18_INFO("Tuner: %s\n", 863 CX18_INFO("Tuner: %s\n",
867 test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ? "Radio" : "TV"); 864 test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ? "Radio" : "TV");
868 cx2341x_log_status(&cx->params, cx->name); 865 cx2341x_log_status(&cx->params, cx->v4l2_dev.name);
869 CX18_INFO("Status flags: 0x%08lx\n", cx->i_flags); 866 CX18_INFO("Status flags: 0x%08lx\n", cx->i_flags);
870 for (i = 0; i < CX18_MAX_STREAMS; i++) { 867 for (i = 0; i < CX18_MAX_STREAMS; i++) {
871 struct cx18_stream *s = &cx->streams[i]; 868 struct cx18_stream *s = &cx->streams[i];
@@ -880,7 +877,8 @@ static int cx18_log_status(struct file *file, void *fh)
880 CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n", 877 CX18_INFO("Read MPEG/VBI: %lld/%lld bytes\n",
881 (long long)cx->mpg_data_received, 878 (long long)cx->mpg_data_received,
882 (long long)cx->vbi_data_inserted); 879 (long long)cx->vbi_data_inserted);
883 CX18_INFO("================== END STATUS CARD #%d ==================\n", cx->num); 880 CX18_INFO("================== END STATUS CARD #%d "
881 "==================\n", cx->instance);
884 return 0; 882 return 0;
885} 883}
886 884