diff options
author | Mike Isely <isely@pobox.com> | 2006-12-27 21:11:22 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:23 -0500 |
commit | fd5a75fe00ec13311289928c2cb17d8676f8db45 (patch) | |
tree | 478dcf0445fc17e64df4036e391106522b54bdea /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | ae2b9e25fdfb63efed3659b19c5cc8778fd981ba (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.c | 23 |
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 4b45299e187d..6acd73ca9ed3 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, | |||
1898 | 1898 | ||
1899 | hdw->eeprom_addr = -1; | 1899 | hdw->eeprom_addr = -1; |
1900 | hdw->unit_number = -1; | 1900 | hdw->unit_number = -1; |
1901 | hdw->v4l_minor_number[0] = -1; | 1901 | hdw->v4l_minor_number_mpeg = -1; |
1902 | hdw->v4l_minor_number[1] = -1; | 1902 | hdw->v4l_minor_number_radio = -1; |
1903 | hdw->v4l_minor_number[2] = -1; | ||
1904 | hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); | 1903 | hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); |
1905 | if (!hdw->ctl_write_buffer) goto fail; | 1904 | if (!hdw->ctl_write_buffer) goto fail; |
1906 | hdw->ctl_read_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); | 1905 | 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, | |||
2548 | } | 2547 | } |
2549 | 2548 | ||
2550 | 2549 | ||
2551 | int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw,int index) | 2550 | int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw, |
2551 | enum pvr2_config index) | ||
2552 | { | 2552 | { |
2553 | return hdw->v4l_minor_number[index]; | 2553 | switch (index) { |
2554 | case pvr2_config_mpeg: return hdw->v4l_minor_number_mpeg; | ||
2555 | case pvr2_config_radio: return hdw->v4l_minor_number_radio; | ||
2556 | default: return -1; | ||
2557 | } | ||
2554 | } | 2558 | } |
2555 | 2559 | ||
2556 | 2560 | ||
2557 | /* Store a v4l minor device number */ | 2561 | /* Store a v4l minor device number */ |
2558 | void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int index,int v) | 2562 | void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw, |
2563 | enum pvr2_config index,int v) | ||
2559 | { | 2564 | { |
2560 | hdw->v4l_minor_number[index] = v; | 2565 | switch (index) { |
2566 | case pvr2_config_mpeg: hdw->v4l_minor_number_mpeg = v; | ||
2567 | case pvr2_config_radio: hdw->v4l_minor_number_radio = v; | ||
2568 | default: break; | ||
2569 | } | ||
2561 | } | 2570 | } |
2562 | 2571 | ||
2563 | 2572 | ||