diff options
Diffstat (limited to 'drivers/media/video/cpia2/cpia2_v4l.c')
| -rw-r--r-- | drivers/media/video/cpia2/cpia2_v4l.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c index 0b4a8f309cfa..6f91415eb7b4 100644 --- a/drivers/media/video/cpia2/cpia2_v4l.c +++ b/drivers/media/video/cpia2/cpia2_v4l.c | |||
| @@ -38,17 +38,12 @@ | |||
| 38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
| 39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
| 40 | #include <linux/videodev.h> | 40 | #include <linux/videodev.h> |
| 41 | #include <linux/stringify.h> | ||
| 41 | #include <media/v4l2-ioctl.h> | 42 | #include <media/v4l2-ioctl.h> |
| 42 | 43 | ||
| 43 | #include "cpia2.h" | 44 | #include "cpia2.h" |
| 44 | #include "cpia2dev.h" | 45 | #include "cpia2dev.h" |
| 45 | 46 | ||
| 46 | |||
| 47 | //#define _CPIA2_DEBUG_ | ||
| 48 | |||
| 49 | #define MAKE_STRING_1(x) #x | ||
| 50 | #define MAKE_STRING(x) MAKE_STRING_1(x) | ||
| 51 | |||
| 52 | static int video_nr = -1; | 47 | static int video_nr = -1; |
| 53 | module_param(video_nr, int, 0); | 48 | module_param(video_nr, int, 0); |
| 54 | MODULE_PARM_DESC(video_nr,"video device to register (0=/dev/video0, etc)"); | 49 | MODULE_PARM_DESC(video_nr,"video device to register (0=/dev/video0, etc)"); |
| @@ -60,26 +55,26 @@ MODULE_PARM_DESC(buffer_size, "Size for each frame buffer in bytes (default 68k) | |||
| 60 | static int num_buffers = 3; | 55 | static int num_buffers = 3; |
| 61 | module_param(num_buffers, int, 0); | 56 | module_param(num_buffers, int, 0); |
| 62 | MODULE_PARM_DESC(num_buffers, "Number of frame buffers (1-" | 57 | MODULE_PARM_DESC(num_buffers, "Number of frame buffers (1-" |
| 63 | MAKE_STRING(VIDEO_MAX_FRAME) ", default 3)"); | 58 | __stringify(VIDEO_MAX_FRAME) ", default 3)"); |
| 64 | 59 | ||
| 65 | static int alternate = DEFAULT_ALT; | 60 | static int alternate = DEFAULT_ALT; |
| 66 | module_param(alternate, int, 0); | 61 | module_param(alternate, int, 0); |
| 67 | MODULE_PARM_DESC(alternate, "USB Alternate (" MAKE_STRING(USBIF_ISO_1) "-" | 62 | MODULE_PARM_DESC(alternate, "USB Alternate (" __stringify(USBIF_ISO_1) "-" |
| 68 | MAKE_STRING(USBIF_ISO_6) ", default " | 63 | __stringify(USBIF_ISO_6) ", default " |
| 69 | MAKE_STRING(DEFAULT_ALT) ")"); | 64 | __stringify(DEFAULT_ALT) ")"); |
| 70 | 65 | ||
| 71 | static int flicker_freq = 60; | 66 | static int flicker_freq = 60; |
| 72 | module_param(flicker_freq, int, 0); | 67 | module_param(flicker_freq, int, 0); |
| 73 | MODULE_PARM_DESC(flicker_freq, "Flicker frequency (" MAKE_STRING(50) "or" | 68 | MODULE_PARM_DESC(flicker_freq, "Flicker frequency (" __stringify(50) "or" |
| 74 | MAKE_STRING(60) ", default " | 69 | __stringify(60) ", default " |
| 75 | MAKE_STRING(60) ")"); | 70 | __stringify(60) ")"); |
| 76 | 71 | ||
| 77 | static int flicker_mode = NEVER_FLICKER; | 72 | static int flicker_mode = NEVER_FLICKER; |
| 78 | module_param(flicker_mode, int, 0); | 73 | module_param(flicker_mode, int, 0); |
| 79 | MODULE_PARM_DESC(flicker_mode, | 74 | MODULE_PARM_DESC(flicker_mode, |
| 80 | "Flicker supression (" MAKE_STRING(NEVER_FLICKER) "or" | 75 | "Flicker supression (" __stringify(NEVER_FLICKER) "or" |
| 81 | MAKE_STRING(ANTI_FLICKER_ON) ", default " | 76 | __stringify(ANTI_FLICKER_ON) ", default " |
| 82 | MAKE_STRING(NEVER_FLICKER) ")"); | 77 | __stringify(NEVER_FLICKER) ")"); |
| 83 | 78 | ||
| 84 | MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>"); | 79 | MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>"); |
| 85 | MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras"); | 80 | MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras"); |
| @@ -1926,7 +1921,6 @@ static const struct v4l2_file_operations fops_template = { | |||
| 1926 | static struct video_device cpia2_template = { | 1921 | static struct video_device cpia2_template = { |
| 1927 | /* I could not find any place for the old .initialize initializer?? */ | 1922 | /* I could not find any place for the old .initialize initializer?? */ |
| 1928 | .name= "CPiA2 Camera", | 1923 | .name= "CPiA2 Camera", |
| 1929 | .minor= -1, | ||
| 1930 | .fops= &fops_template, | 1924 | .fops= &fops_template, |
| 1931 | .release= video_device_release, | 1925 | .release= video_device_release, |
| 1932 | }; | 1926 | }; |
| @@ -1967,9 +1961,9 @@ void cpia2_unregister_camera(struct camera_data *cam) | |||
| 1967 | if (!cam->open_count) { | 1961 | if (!cam->open_count) { |
| 1968 | video_unregister_device(cam->vdev); | 1962 | video_unregister_device(cam->vdev); |
| 1969 | } else { | 1963 | } else { |
| 1970 | LOG("/dev/video%d removed while open, " | 1964 | LOG("%s removed while open, deferring " |
| 1971 | "deferring video_unregister_device\n", | 1965 | "video_unregister_device\n", |
| 1972 | cam->vdev->num); | 1966 | video_device_node_name(cam->vdev)); |
| 1973 | } | 1967 | } |
| 1974 | } | 1968 | } |
| 1975 | 1969 | ||
