diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-09-20 05:39:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:37:12 -0400 |
commit | 72ab97cecb7225a4c9f74cdd80268b50b74697bb (patch) | |
tree | 3c942aa1c1538ad83c5f49fbc6ab01ea1a584789 /drivers/media/video/gspca/mars.c | |
parent | 1b60e1adc713e8d375dc117f5c3b5032d5b79abe (diff) |
V4L/DVB (9079): gspca: Return error code from stream start functions.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/mars.c')
-rw-r--r-- | drivers/media/video/gspca/mars.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c index 4d5db47ba8cb..277ca34a8817 100644 --- a/drivers/media/video/gspca/mars.c +++ b/drivers/media/video/gspca/mars.c | |||
@@ -134,7 +134,7 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
137 | static void sd_start(struct gspca_dev *gspca_dev) | 137 | static int sd_start(struct gspca_dev *gspca_dev) |
138 | { | 138 | { |
139 | int err_code; | 139 | int err_code; |
140 | __u8 *data; | 140 | __u8 *data; |
@@ -143,9 +143,10 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
143 | int intpipe; | 143 | int intpipe; |
144 | 144 | ||
145 | PDEBUG(D_STREAM, "camera start, iface %d, alt 8", gspca_dev->iface); | 145 | PDEBUG(D_STREAM, "camera start, iface %d, alt 8", gspca_dev->iface); |
146 | if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, 8) < 0) { | 146 | err_code = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 8); |
147 | if (err_code < 0) { | ||
147 | PDEBUG(D_ERR|D_STREAM, "Set packet size: set interface error"); | 148 | PDEBUG(D_ERR|D_STREAM, "Set packet size: set interface error"); |
148 | return; | 149 | return err_code; |
149 | } | 150 | } |
150 | 151 | ||
151 | data = gspca_dev->usb_buf; | 152 | data = gspca_dev->usb_buf; |
@@ -154,7 +155,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
154 | 155 | ||
155 | err_code = reg_w(gspca_dev, data[0], 2); | 156 | err_code = reg_w(gspca_dev, data[0], 2); |
156 | if (err_code < 0) | 157 | if (err_code < 0) |
157 | return; | 158 | return err_code; |
158 | 159 | ||
159 | /* | 160 | /* |
160 | Initialize the MR97113 chip register | 161 | Initialize the MR97113 chip register |
@@ -180,14 +181,14 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
180 | 181 | ||
181 | err_code = reg_w(gspca_dev, data[0], 11); | 182 | err_code = reg_w(gspca_dev, data[0], 11); |
182 | if (err_code < 0) | 183 | if (err_code < 0) |
183 | return; | 184 | return err_code; |
184 | 185 | ||
185 | data[0] = 0x23; /* address */ | 186 | data[0] = 0x23; /* address */ |
186 | data[1] = 0x09; /* reg 35, append frame header */ | 187 | data[1] = 0x09; /* reg 35, append frame header */ |
187 | 188 | ||
188 | err_code = reg_w(gspca_dev, data[0], 2); | 189 | err_code = reg_w(gspca_dev, data[0], 2); |
189 | if (err_code < 0) | 190 | if (err_code < 0) |
190 | return; | 191 | return err_code; |
191 | 192 | ||
192 | data[0] = 0x3c; /* address */ | 193 | data[0] = 0x3c; /* address */ |
193 | /* if (gspca_dev->width == 1280) */ | 194 | /* if (gspca_dev->width == 1280) */ |
@@ -198,7 +199,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
198 | * (unit: 4KB) 200KB */ | 199 | * (unit: 4KB) 200KB */ |
199 | err_code = reg_w(gspca_dev, data[0], 2); | 200 | err_code = reg_w(gspca_dev, data[0], 2); |
200 | if (err_code < 0) | 201 | if (err_code < 0) |
201 | return; | 202 | return err_code; |
202 | 203 | ||
203 | if (0) { /* fixed dark-gain */ | 204 | if (0) { /* fixed dark-gain */ |
204 | data[1] = 0; /* reg 94, Y Gain (1.75) */ | 205 | data[1] = 0; /* reg 94, Y Gain (1.75) */ |
@@ -240,13 +241,13 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
240 | 241 | ||
241 | err_code = reg_w(gspca_dev, data[0], 6); | 242 | err_code = reg_w(gspca_dev, data[0], 6); |
242 | if (err_code < 0) | 243 | if (err_code < 0) |
243 | return; | 244 | return err_code; |
244 | 245 | ||
245 | data[0] = 0x67; | 246 | data[0] = 0x67; |
246 | data[1] = 0x13; /* reg 103, first pixel B, disable sharpness */ | 247 | data[1] = 0x13; /* reg 103, first pixel B, disable sharpness */ |
247 | err_code = reg_w(gspca_dev, data[0], 2); | 248 | err_code = reg_w(gspca_dev, data[0], 2); |
248 | if (err_code < 0) | 249 | if (err_code < 0) |
249 | return; | 250 | return err_code; |
250 | 251 | ||
251 | /* | 252 | /* |
252 | * initialize the value of MI sensor... | 253 | * initialize the value of MI sensor... |
@@ -326,6 +327,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
326 | data[0] = 0x00; | 327 | data[0] = 0x00; |
327 | data[1] = 0x4d; /* ISOC transfering enable... */ | 328 | data[1] = 0x4d; /* ISOC transfering enable... */ |
328 | reg_w(gspca_dev, data[0], 2); | 329 | reg_w(gspca_dev, data[0], 2); |
330 | return err_code; | ||
329 | } | 331 | } |
330 | 332 | ||
331 | static void sd_stopN(struct gspca_dev *gspca_dev) | 333 | static void sd_stopN(struct gspca_dev *gspca_dev) |