diff options
author | Luca Risolia <luca.risolia@studio.unibo.it> | 2006-01-13 12:19:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-31 20:23:38 -0500 |
commit | cd6fcc555fe278263880abdb93352ab205099db9 (patch) | |
tree | de09c1d3183ed41c1eef653d90a29a03370b2128 /drivers/usb/media/sn9c102.h | |
parent | e988fc8a56bb3f76624dd7b0fb13ae3eaccefa59 (diff) |
[PATCH] USB: SN9C10x driver updates
SN9C10x driver updates:
- Use kzalloc() instead of kmalloc()
- Move some macro definitions from sn9c102.h to sn9c102_core.c
- Use vfree() and vmalloc_32() instead of rvfree() and rvmalloc()
- Fix mmap() sys call
- Documentation updates
Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/media/sn9c102.h')
-rw-r--r-- | drivers/usb/media/sn9c102.h | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/usb/media/sn9c102.h b/drivers/usb/media/sn9c102.h index 967c6b6bc0fa..17d60c1eea7e 100644 --- a/drivers/usb/media/sn9c102.h +++ b/drivers/usb/media/sn9c102.h | |||
@@ -23,7 +23,8 @@ | |||
23 | 23 | ||
24 | #include <linux/version.h> | 24 | #include <linux/version.h> |
25 | #include <linux/usb.h> | 25 | #include <linux/usb.h> |
26 | #include <linux/videodev.h> | 26 | #include <linux/videodev2.h> |
27 | #include <media/v4l2-common.h> | ||
27 | #include <linux/device.h> | 28 | #include <linux/device.h> |
28 | #include <linux/list.h> | 29 | #include <linux/list.h> |
29 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
@@ -52,13 +53,6 @@ | |||
52 | 53 | ||
53 | /*****************************************************************************/ | 54 | /*****************************************************************************/ |
54 | 55 | ||
55 | #define SN9C102_MODULE_NAME "V4L2 driver for SN9C10x PC Camera Controllers" | ||
56 | #define SN9C102_MODULE_AUTHOR "(C) 2004-2006 Luca Risolia" | ||
57 | #define SN9C102_AUTHOR_EMAIL "<luca.risolia@studio.unibo.it>" | ||
58 | #define SN9C102_MODULE_LICENSE "GPL" | ||
59 | #define SN9C102_MODULE_VERSION "1:1.25" | ||
60 | #define SN9C102_MODULE_VERSION_CODE KERNEL_VERSION(1, 0, 25) | ||
61 | |||
62 | enum sn9c102_bridge { | 56 | enum sn9c102_bridge { |
63 | BRIDGE_SN9C101 = 0x01, | 57 | BRIDGE_SN9C101 = 0x01, |
64 | BRIDGE_SN9C102 = 0x02, | 58 | BRIDGE_SN9C102 = 0x02, |
@@ -119,8 +113,6 @@ static DECLARE_MUTEX(sn9c102_sysfs_lock); | |||
119 | static DECLARE_RWSEM(sn9c102_disconnect); | 113 | static DECLARE_RWSEM(sn9c102_disconnect); |
120 | 114 | ||
121 | struct sn9c102_device { | 115 | struct sn9c102_device { |
122 | struct device dev; | ||
123 | |||
124 | struct video_device* v4ldev; | 116 | struct video_device* v4ldev; |
125 | 117 | ||
126 | enum sn9c102_bridge bridge; | 118 | enum sn9c102_bridge bridge; |
@@ -161,7 +153,6 @@ sn9c102_attach_sensor(struct sn9c102_device* cam, | |||
161 | struct sn9c102_sensor* sensor) | 153 | struct sn9c102_sensor* sensor) |
162 | { | 154 | { |
163 | cam->sensor = sensor; | 155 | cam->sensor = sensor; |
164 | cam->sensor->dev = &cam->dev; | ||
165 | cam->sensor->usbdev = cam->usbdev; | 156 | cam->sensor->usbdev = cam->usbdev; |
166 | } | 157 | } |
167 | 158 | ||
@@ -174,14 +165,19 @@ sn9c102_attach_sensor(struct sn9c102_device* cam, | |||
174 | do { \ | 165 | do { \ |
175 | if (debug >= (level)) { \ | 166 | if (debug >= (level)) { \ |
176 | if ((level) == 1) \ | 167 | if ((level) == 1) \ |
177 | dev_err(&cam->dev, fmt "\n", ## args); \ | 168 | dev_err(&cam->usbdev->dev, fmt "\n", ## args); \ |
178 | else if ((level) == 2) \ | 169 | else if ((level) == 2) \ |
179 | dev_info(&cam->dev, fmt "\n", ## args); \ | 170 | dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ |
180 | else if ((level) >= 3) \ | 171 | else if ((level) >= 3) \ |
181 | dev_info(&cam->dev, "[%s:%d] " fmt "\n", \ | 172 | dev_info(&cam->usbdev->dev, "[%s:%d] " fmt "\n", \ |
182 | __FUNCTION__, __LINE__ , ## args); \ | 173 | __FUNCTION__, __LINE__ , ## args); \ |
183 | } \ | 174 | } \ |
184 | } while (0) | 175 | } while (0) |
176 | # define V4LDBG(level, name, cmd) \ | ||
177 | do { \ | ||
178 | if (debug >= (level)) \ | ||
179 | v4l_print_ioctl(name, cmd); \ | ||
180 | } while (0) | ||
185 | # define KDBG(level, fmt, args...) \ | 181 | # define KDBG(level, fmt, args...) \ |
186 | do { \ | 182 | do { \ |
187 | if (debug >= (level)) { \ | 183 | if (debug >= (level)) { \ |
@@ -193,8 +189,9 @@ do { \ | |||
193 | } \ | 189 | } \ |
194 | } while (0) | 190 | } while (0) |
195 | #else | 191 | #else |
196 | # define KDBG(level, fmt, args...) do {;} while(0) | ||
197 | # define DBG(level, fmt, args...) do {;} while(0) | 192 | # define DBG(level, fmt, args...) do {;} while(0) |
193 | # define V4LDBG(level, name, cmd) do {;} while(0) | ||
194 | # define KDBG(level, fmt, args...) do {;} while(0) | ||
198 | #endif | 195 | #endif |
199 | 196 | ||
200 | #undef PDBG | 197 | #undef PDBG |