aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-12-27 23:11:22 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 13:34:23 -0200
commitfd5a75fe00ec13311289928c2cb17d8676f8db45 (patch)
tree478dcf0445fc17e64df4036e391106522b54bdea /drivers/media/video/pvrusb2/pvrusb2-hdw.c
parentae2b9e25fdfb63efed3659b19c5cc8778fd981ba (diff)
V4L/DVB (5040): Pvrusb2: Use enumeration for minor number get / store code
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 4b45299e187..6acd73ca9ed 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1898,9 +1898,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
hdw->eeprom_addr = -1;
hdw->unit_number = -1;
- hdw->v4l_minor_number[0] = -1;
- hdw->v4l_minor_number[1] = -1;
- hdw->v4l_minor_number[2] = -1;
+ hdw->v4l_minor_number_mpeg = -1;
+ hdw->v4l_minor_number_radio = -1;
hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL);
if (!hdw->ctl_write_buffer) goto fail;
hdw->ctl_read_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL);
@@ -2548,16 +2547,26 @@ int pvr2_hdw_cpufw_get(struct pvr2_hdw *hdw,unsigned int offs,
}
-int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw,int index)
+int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw,
+ enum pvr2_config index)
{
- return hdw->v4l_minor_number[index];
+ switch (index) {
+ case pvr2_config_mpeg: return hdw->v4l_minor_number_mpeg;
+ case pvr2_config_radio: return hdw->v4l_minor_number_radio;
+ default: return -1;
+ }
}
/* Store a v4l minor device number */
-void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int index,int v)
+void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,
+ enum pvr2_config index,int v)
{
- hdw->v4l_minor_number[index] = v;
+ switch (index) {
+ case pvr2_config_mpeg: hdw->v4l_minor_number_mpeg = v;
+ case pvr2_config_radio: hdw->v4l_minor_number_radio = v;
+ default: break;
+ }
}