diff options
Diffstat (limited to 'drivers/media')
| -rw-r--r-- | drivers/media/dvb/dvb-usb/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/media/dvb/ngene/ngene-core.c | 1 | ||||
| -rw-r--r-- | drivers/media/radio/saa7706h.c | 2 | ||||
| -rw-r--r-- | drivers/media/radio/tef6862.c | 2 | ||||
| -rw-r--r-- | drivers/media/rc/imon.c | 31 | ||||
| -rw-r--r-- | drivers/media/rc/ite-cir.c | 1 | ||||
| -rw-r--r-- | drivers/media/rc/mceusb.c | 2 | ||||
| -rw-r--r-- | drivers/media/rc/rc-main.c | 4 | ||||
| -rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/m52790.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/soc_camera.c | 48 | ||||
| -rw-r--r-- | drivers/media/video/tda9840.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/tea6415c.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/tea6420.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/upd64031a.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/upd64083.c | 2 | ||||
| -rw-r--r-- | drivers/media/video/v4l2-device.c | 5 | ||||
| -rw-r--r-- | drivers/media/video/v4l2-subdev.c | 14 |
18 files changed, 98 insertions, 28 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index ccbd39a38c46..c545039287ad 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
| @@ -356,6 +356,8 @@ config DVB_USB_LME2510 | |||
| 356 | select DVB_TDA826X if !DVB_FE_CUSTOMISE | 356 | select DVB_TDA826X if !DVB_FE_CUSTOMISE |
| 357 | select DVB_STV0288 if !DVB_FE_CUSTOMISE | 357 | select DVB_STV0288 if !DVB_FE_CUSTOMISE |
| 358 | select DVB_IX2505V if !DVB_FE_CUSTOMISE | 358 | select DVB_IX2505V if !DVB_FE_CUSTOMISE |
| 359 | select DVB_STV0299 if !DVB_FE_CUSTOMISE | ||
| 360 | select DVB_PLL if !DVB_FE_CUSTOMISE | ||
| 359 | help | 361 | help |
| 360 | Say Y here to support the LME DM04/QQBOX DVB-S USB2.0 . | 362 | Say Y here to support the LME DM04/QQBOX DVB-S USB2.0 . |
| 361 | 363 | ||
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index ccc2d1af49d4..6927c726ce35 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
| @@ -1520,6 +1520,7 @@ static int init_channel(struct ngene_channel *chan) | |||
| 1520 | if (dev->ci.en && (io & NGENE_IO_TSOUT)) { | 1520 | if (dev->ci.en && (io & NGENE_IO_TSOUT)) { |
| 1521 | dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1); | 1521 | dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1); |
| 1522 | set_transfer(chan, 1); | 1522 | set_transfer(chan, 1); |
| 1523 | chan->dev->channel[2].DataFormatFlags = DF_SWAP32; | ||
| 1523 | set_transfer(&chan->dev->channel[2], 1); | 1524 | set_transfer(&chan->dev->channel[2], 1); |
| 1524 | dvb_register_device(adapter, &chan->ci_dev, | 1525 | dvb_register_device(adapter, &chan->ci_dev, |
| 1525 | &ngene_dvbdev_ci, (void *) chan, | 1526 | &ngene_dvbdev_ci, (void *) chan, |
diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c index 585680ffbfb6..b1193dfc5087 100644 --- a/drivers/media/radio/saa7706h.c +++ b/drivers/media/radio/saa7706h.c | |||
| @@ -376,7 +376,7 @@ static int __devinit saa7706h_probe(struct i2c_client *client, | |||
| 376 | v4l_info(client, "chip found @ 0x%02x (%s)\n", | 376 | v4l_info(client, "chip found @ 0x%02x (%s)\n", |
| 377 | client->addr << 1, client->adapter->name); | 377 | client->addr << 1, client->adapter->name); |
| 378 | 378 | ||
| 379 | state = kmalloc(sizeof(struct saa7706h_state), GFP_KERNEL); | 379 | state = kzalloc(sizeof(struct saa7706h_state), GFP_KERNEL); |
| 380 | if (state == NULL) | 380 | if (state == NULL) |
| 381 | return -ENOMEM; | 381 | return -ENOMEM; |
| 382 | sd = &state->sd; | 382 | sd = &state->sd; |
diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c index 7c0d77751f6e..0991e1973678 100644 --- a/drivers/media/radio/tef6862.c +++ b/drivers/media/radio/tef6862.c | |||
| @@ -176,7 +176,7 @@ static int __devinit tef6862_probe(struct i2c_client *client, | |||
| 176 | v4l_info(client, "chip found @ 0x%02x (%s)\n", | 176 | v4l_info(client, "chip found @ 0x%02x (%s)\n", |
| 177 | client->addr << 1, client->adapter->name); | 177 | client->addr << 1, client->adapter->name); |
| 178 | 178 | ||
| 179 | state = kmalloc(sizeof(struct tef6862_state), GFP_KERNEL); | 179 | state = kzalloc(sizeof(struct tef6862_state), GFP_KERNEL); |
| 180 | if (state == NULL) | 180 | if (state == NULL) |
| 181 | return -ENOMEM; | 181 | return -ENOMEM; |
| 182 | state->freq = TEF6862_LO_FREQ; | 182 | state->freq = TEF6862_LO_FREQ; |
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index ebd68edf5b24..8fc0f081b470 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" | 46 | #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" |
| 47 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" | 47 | #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" |
| 48 | #define MOD_NAME "imon" | 48 | #define MOD_NAME "imon" |
| 49 | #define MOD_VERSION "0.9.2" | 49 | #define MOD_VERSION "0.9.3" |
| 50 | 50 | ||
| 51 | #define DISPLAY_MINOR_BASE 144 | 51 | #define DISPLAY_MINOR_BASE 144 |
| 52 | #define DEVICE_NAME "lcd%d" | 52 | #define DEVICE_NAME "lcd%d" |
| @@ -460,8 +460,9 @@ static int display_close(struct inode *inode, struct file *file) | |||
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | /** | 462 | /** |
| 463 | * Sends a packet to the device -- this function must be called | 463 | * Sends a packet to the device -- this function must be called with |
| 464 | * with ictx->lock held. | 464 | * ictx->lock held, or its unlock/lock sequence while waiting for tx |
| 465 | * to complete can/will lead to a deadlock. | ||
| 465 | */ | 466 | */ |
| 466 | static int send_packet(struct imon_context *ictx) | 467 | static int send_packet(struct imon_context *ictx) |
| 467 | { | 468 | { |
| @@ -991,12 +992,21 @@ static void imon_touch_display_timeout(unsigned long data) | |||
| 991 | * the iMON remotes, and those used by the Windows MCE remotes (which is | 992 | * the iMON remotes, and those used by the Windows MCE remotes (which is |
| 992 | * really just RC-6), but only one or the other at a time, as the signals | 993 | * really just RC-6), but only one or the other at a time, as the signals |
| 993 | * are decoded onboard the receiver. | 994 | * are decoded onboard the receiver. |
| 995 | * | ||
| 996 | * This function gets called two different ways, one way is from | ||
| 997 | * rc_register_device, for initial protocol selection/setup, and the other is | ||
| 998 | * via a userspace-initiated protocol change request, either by direct sysfs | ||
| 999 | * prodding or by something like ir-keytable. In the rc_register_device case, | ||
| 1000 | * the imon context lock is already held, but when initiated from userspace, | ||
| 1001 | * it is not, so we must acquire it prior to calling send_packet, which | ||
| 1002 | * requires that the lock is held. | ||
| 994 | */ | 1003 | */ |
| 995 | static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | 1004 | static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) |
| 996 | { | 1005 | { |
| 997 | int retval; | 1006 | int retval; |
| 998 | struct imon_context *ictx = rc->priv; | 1007 | struct imon_context *ictx = rc->priv; |
| 999 | struct device *dev = ictx->dev; | 1008 | struct device *dev = ictx->dev; |
| 1009 | bool unlock = false; | ||
| 1000 | unsigned char ir_proto_packet[] = { | 1010 | unsigned char ir_proto_packet[] = { |
| 1001 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; | 1011 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; |
| 1002 | 1012 | ||
| @@ -1029,6 +1039,11 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 1029 | 1039 | ||
| 1030 | memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); | 1040 | memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); |
| 1031 | 1041 | ||
| 1042 | if (!mutex_is_locked(&ictx->lock)) { | ||
| 1043 | unlock = true; | ||
| 1044 | mutex_lock(&ictx->lock); | ||
| 1045 | } | ||
| 1046 | |||
| 1032 | retval = send_packet(ictx); | 1047 | retval = send_packet(ictx); |
| 1033 | if (retval) | 1048 | if (retval) |
| 1034 | goto out; | 1049 | goto out; |
| @@ -1037,6 +1052,9 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 1037 | ictx->pad_mouse = false; | 1052 | ictx->pad_mouse = false; |
| 1038 | 1053 | ||
| 1039 | out: | 1054 | out: |
| 1055 | if (unlock) | ||
| 1056 | mutex_unlock(&ictx->lock); | ||
| 1057 | |||
| 1040 | return retval; | 1058 | return retval; |
| 1041 | } | 1059 | } |
| 1042 | 1060 | ||
| @@ -2134,6 +2152,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
| 2134 | goto rdev_setup_failed; | 2152 | goto rdev_setup_failed; |
| 2135 | } | 2153 | } |
| 2136 | 2154 | ||
| 2155 | mutex_unlock(&ictx->lock); | ||
| 2137 | return ictx; | 2156 | return ictx; |
| 2138 | 2157 | ||
| 2139 | rdev_setup_failed: | 2158 | rdev_setup_failed: |
| @@ -2205,6 +2224,7 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf, | |||
| 2205 | goto urb_submit_failed; | 2224 | goto urb_submit_failed; |
| 2206 | } | 2225 | } |
| 2207 | 2226 | ||
| 2227 | mutex_unlock(&ictx->lock); | ||
| 2208 | return ictx; | 2228 | return ictx; |
| 2209 | 2229 | ||
| 2210 | urb_submit_failed: | 2230 | urb_submit_failed: |
| @@ -2299,6 +2319,8 @@ static int __devinit imon_probe(struct usb_interface *interface, | |||
| 2299 | usb_set_intfdata(interface, ictx); | 2319 | usb_set_intfdata(interface, ictx); |
| 2300 | 2320 | ||
| 2301 | if (ifnum == 0) { | 2321 | if (ifnum == 0) { |
| 2322 | mutex_lock(&ictx->lock); | ||
| 2323 | |||
| 2302 | if (product == 0xffdc && ictx->rf_device) { | 2324 | if (product == 0xffdc && ictx->rf_device) { |
| 2303 | sysfs_err = sysfs_create_group(&interface->dev.kobj, | 2325 | sysfs_err = sysfs_create_group(&interface->dev.kobj, |
| 2304 | &imon_rf_attr_group); | 2326 | &imon_rf_attr_group); |
| @@ -2309,13 +2331,14 @@ static int __devinit imon_probe(struct usb_interface *interface, | |||
| 2309 | 2331 | ||
| 2310 | if (ictx->display_supported) | 2332 | if (ictx->display_supported) |
| 2311 | imon_init_display(ictx, interface); | 2333 | imon_init_display(ictx, interface); |
| 2334 | |||
| 2335 | mutex_unlock(&ictx->lock); | ||
| 2312 | } | 2336 | } |
| 2313 | 2337 | ||
| 2314 | dev_info(dev, "iMON device (%04x:%04x, intf%d) on " | 2338 | dev_info(dev, "iMON device (%04x:%04x, intf%d) on " |
| 2315 | "usb<%d:%d> initialized\n", vendor, product, ifnum, | 2339 | "usb<%d:%d> initialized\n", vendor, product, ifnum, |
| 2316 | usbdev->bus->busnum, usbdev->devnum); | 2340 | usbdev->bus->busnum, usbdev->devnum); |
| 2317 | 2341 | ||
| 2318 | mutex_unlock(&ictx->lock); | ||
| 2319 | mutex_unlock(&driver_lock); | 2342 | mutex_unlock(&driver_lock); |
| 2320 | 2343 | ||
| 2321 | return 0; | 2344 | return 0; |
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index accaf6c9789a..43908a70bd8b 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
| 37 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
| 38 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
| 39 | #include <linux/delay.h> | ||
| 39 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
| 40 | #include <linux/input.h> | 41 | #include <linux/input.h> |
| 41 | #include <linux/bitops.h> | 42 | #include <linux/bitops.h> |
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 044fb7a382d6..0c273ec465c9 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
| @@ -220,6 +220,8 @@ static struct usb_device_id mceusb_dev_table[] = { | |||
| 220 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, | 220 | { USB_DEVICE(VENDOR_PHILIPS, 0x206c) }, |
| 221 | /* Philips/Spinel plus IR transceiver for ASUS */ | 221 | /* Philips/Spinel plus IR transceiver for ASUS */ |
| 222 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, | 222 | { USB_DEVICE(VENDOR_PHILIPS, 0x2088) }, |
| 223 | /* Philips IR transceiver (Dell branded) */ | ||
| 224 | { USB_DEVICE(VENDOR_PHILIPS, 0x2093) }, | ||
| 223 | /* Realtek MCE IR Receiver and card reader */ | 225 | /* Realtek MCE IR Receiver and card reader */ |
| 224 | { USB_DEVICE(VENDOR_REALTEK, 0x0161), | 226 | { USB_DEVICE(VENDOR_REALTEK, 0x0161), |
| 225 | .driver_info = MULTIFUNCTION }, | 227 | .driver_info = MULTIFUNCTION }, |
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index f53f9c68d38d..a2706648e365 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
| @@ -707,7 +707,8 @@ static void ir_close(struct input_dev *idev) | |||
| 707 | { | 707 | { |
| 708 | struct rc_dev *rdev = input_get_drvdata(idev); | 708 | struct rc_dev *rdev = input_get_drvdata(idev); |
| 709 | 709 | ||
| 710 | rdev->close(rdev); | 710 | if (rdev) |
| 711 | rdev->close(rdev); | ||
| 711 | } | 712 | } |
| 712 | 713 | ||
| 713 | /* class for /sys/class/rc */ | 714 | /* class for /sys/class/rc */ |
| @@ -733,6 +734,7 @@ static struct { | |||
| 733 | { RC_TYPE_SONY, "sony" }, | 734 | { RC_TYPE_SONY, "sony" }, |
| 734 | { RC_TYPE_RC5_SZ, "rc-5-sz" }, | 735 | { RC_TYPE_RC5_SZ, "rc-5-sz" }, |
| 735 | { RC_TYPE_LIRC, "lirc" }, | 736 | { RC_TYPE_LIRC, "lirc" }, |
| 737 | { RC_TYPE_OTHER, "other" }, | ||
| 736 | }; | 738 | }; |
| 737 | 739 | ||
| 738 | #define PROTO_NONE "none" | 740 | #define PROTO_NONE "none" |
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index c820e2f53527..3f442003623d 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
| @@ -524,7 +524,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
| 524 | for (todo = 32; todo > 0; todo -= bits) { | 524 | for (todo = 32; todo > 0; todo -= bits) { |
| 525 | ev.pulse = samples & 0x80000000 ? false : true; | 525 | ev.pulse = samples & 0x80000000 ? false : true; |
| 526 | bits = min(todo, 32U - fls(ev.pulse ? samples : ~samples)); | 526 | bits = min(todo, 32U - fls(ev.pulse ? samples : ~samples)); |
| 527 | ev.duration = (bits * NSEC_PER_SEC) / (1000 * ir_samplerate); | 527 | ev.duration = (bits * (NSEC_PER_SEC / 1000)) / ir_samplerate; |
| 528 | ir_raw_event_store_with_filter(ir->dev, &ev); | 528 | ir_raw_event_store_with_filter(ir->dev, &ev); |
| 529 | samples <<= bits; | 529 | samples <<= bits; |
| 530 | } | 530 | } |
diff --git a/drivers/media/video/m52790.c b/drivers/media/video/m52790.c index 5e1c9a81984c..303ffa7df4ac 100644 --- a/drivers/media/video/m52790.c +++ b/drivers/media/video/m52790.c | |||
| @@ -174,7 +174,7 @@ static int m52790_probe(struct i2c_client *client, | |||
| 174 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 174 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 175 | client->addr << 1, client->adapter->name); | 175 | client->addr << 1, client->adapter->name); |
| 176 | 176 | ||
| 177 | state = kmalloc(sizeof(struct m52790_state), GFP_KERNEL); | 177 | state = kzalloc(sizeof(struct m52790_state), GFP_KERNEL); |
| 178 | if (state == NULL) | 178 | if (state == NULL) |
| 179 | return -ENOMEM; | 179 | return -ENOMEM; |
| 180 | 180 | ||
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 3973f9a94753..ddb4c091dedc 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
| @@ -136,11 +136,50 @@ unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, | |||
| 136 | } | 136 | } |
| 137 | EXPORT_SYMBOL(soc_camera_apply_sensor_flags); | 137 | EXPORT_SYMBOL(soc_camera_apply_sensor_flags); |
| 138 | 138 | ||
| 139 | #define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ | ||
| 140 | ((x) >> 24) & 0xff | ||
| 141 | |||
| 142 | static int soc_camera_try_fmt(struct soc_camera_device *icd, | ||
| 143 | struct v4l2_format *f) | ||
| 144 | { | ||
| 145 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
| 146 | struct v4l2_pix_format *pix = &f->fmt.pix; | ||
| 147 | int ret; | ||
| 148 | |||
| 149 | dev_dbg(&icd->dev, "TRY_FMT(%c%c%c%c, %ux%u)\n", | ||
| 150 | pixfmtstr(pix->pixelformat), pix->width, pix->height); | ||
| 151 | |||
| 152 | pix->bytesperline = 0; | ||
| 153 | pix->sizeimage = 0; | ||
| 154 | |||
| 155 | ret = ici->ops->try_fmt(icd, f); | ||
| 156 | if (ret < 0) | ||
| 157 | return ret; | ||
| 158 | |||
| 159 | if (!pix->sizeimage) { | ||
| 160 | if (!pix->bytesperline) { | ||
| 161 | const struct soc_camera_format_xlate *xlate; | ||
| 162 | |||
| 163 | xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); | ||
| 164 | if (!xlate) | ||
| 165 | return -EINVAL; | ||
| 166 | |||
| 167 | ret = soc_mbus_bytes_per_line(pix->width, | ||
| 168 | xlate->host_fmt); | ||
| 169 | if (ret > 0) | ||
| 170 | pix->bytesperline = ret; | ||
| 171 | } | ||
| 172 | if (pix->bytesperline) | ||
| 173 | pix->sizeimage = pix->bytesperline * pix->height; | ||
| 174 | } | ||
| 175 | |||
| 176 | return 0; | ||
| 177 | } | ||
| 178 | |||
| 139 | static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv, | 179 | static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv, |
| 140 | struct v4l2_format *f) | 180 | struct v4l2_format *f) |
| 141 | { | 181 | { |
| 142 | struct soc_camera_device *icd = file->private_data; | 182 | struct soc_camera_device *icd = file->private_data; |
| 143 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | ||
| 144 | 183 | ||
| 145 | WARN_ON(priv != file->private_data); | 184 | WARN_ON(priv != file->private_data); |
| 146 | 185 | ||
| @@ -149,7 +188,7 @@ static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv, | |||
| 149 | return -EINVAL; | 188 | return -EINVAL; |
| 150 | 189 | ||
| 151 | /* limit format to hardware capabilities */ | 190 | /* limit format to hardware capabilities */ |
| 152 | return ici->ops->try_fmt(icd, f); | 191 | return soc_camera_try_fmt(icd, f); |
| 153 | } | 192 | } |
| 154 | 193 | ||
| 155 | static int soc_camera_enum_input(struct file *file, void *priv, | 194 | static int soc_camera_enum_input(struct file *file, void *priv, |
| @@ -362,9 +401,6 @@ static void soc_camera_free_user_formats(struct soc_camera_device *icd) | |||
| 362 | icd->user_formats = NULL; | 401 | icd->user_formats = NULL; |
| 363 | } | 402 | } |
| 364 | 403 | ||
| 365 | #define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ | ||
| 366 | ((x) >> 24) & 0xff | ||
| 367 | |||
| 368 | /* Called with .vb_lock held, or from the first open(2), see comment there */ | 404 | /* Called with .vb_lock held, or from the first open(2), see comment there */ |
| 369 | static int soc_camera_set_fmt(struct soc_camera_device *icd, | 405 | static int soc_camera_set_fmt(struct soc_camera_device *icd, |
| 370 | struct v4l2_format *f) | 406 | struct v4l2_format *f) |
| @@ -377,7 +413,7 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd, | |||
| 377 | pixfmtstr(pix->pixelformat), pix->width, pix->height); | 413 | pixfmtstr(pix->pixelformat), pix->width, pix->height); |
| 378 | 414 | ||
| 379 | /* We always call try_fmt() before set_fmt() or set_crop() */ | 415 | /* We always call try_fmt() before set_fmt() or set_crop() */ |
| 380 | ret = ici->ops->try_fmt(icd, f); | 416 | ret = soc_camera_try_fmt(icd, f); |
| 381 | if (ret < 0) | 417 | if (ret < 0) |
| 382 | return ret; | 418 | return ret; |
| 383 | 419 | ||
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index 5d4cf3b3d435..22fa8202d5ca 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c | |||
| @@ -171,7 +171,7 @@ static int tda9840_probe(struct i2c_client *client, | |||
| 171 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 171 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 172 | client->addr << 1, client->adapter->name); | 172 | client->addr << 1, client->adapter->name); |
| 173 | 173 | ||
| 174 | sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); | 174 | sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); |
| 175 | if (sd == NULL) | 175 | if (sd == NULL) |
| 176 | return -ENOMEM; | 176 | return -ENOMEM; |
| 177 | v4l2_i2c_subdev_init(sd, client, &tda9840_ops); | 177 | v4l2_i2c_subdev_init(sd, client, &tda9840_ops); |
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 19621ed523ec..827425c5b866 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c | |||
| @@ -152,7 +152,7 @@ static int tea6415c_probe(struct i2c_client *client, | |||
| 152 | 152 | ||
| 153 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 153 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 154 | client->addr << 1, client->adapter->name); | 154 | client->addr << 1, client->adapter->name); |
| 155 | sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); | 155 | sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); |
| 156 | if (sd == NULL) | 156 | if (sd == NULL) |
| 157 | return -ENOMEM; | 157 | return -ENOMEM; |
| 158 | v4l2_i2c_subdev_init(sd, client, &tea6415c_ops); | 158 | v4l2_i2c_subdev_init(sd, client, &tea6415c_ops); |
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index 5ea840401f21..f350b6c24500 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c | |||
| @@ -125,7 +125,7 @@ static int tea6420_probe(struct i2c_client *client, | |||
| 125 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 125 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 126 | client->addr << 1, client->adapter->name); | 126 | client->addr << 1, client->adapter->name); |
| 127 | 127 | ||
| 128 | sd = kmalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); | 128 | sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); |
| 129 | if (sd == NULL) | 129 | if (sd == NULL) |
| 130 | return -ENOMEM; | 130 | return -ENOMEM; |
| 131 | v4l2_i2c_subdev_init(sd, client, &tea6420_ops); | 131 | v4l2_i2c_subdev_init(sd, client, &tea6420_ops); |
diff --git a/drivers/media/video/upd64031a.c b/drivers/media/video/upd64031a.c index f8138c75be8b..1aab96a88203 100644 --- a/drivers/media/video/upd64031a.c +++ b/drivers/media/video/upd64031a.c | |||
| @@ -230,7 +230,7 @@ static int upd64031a_probe(struct i2c_client *client, | |||
| 230 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 230 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 231 | client->addr << 1, client->adapter->name); | 231 | client->addr << 1, client->adapter->name); |
| 232 | 232 | ||
| 233 | state = kmalloc(sizeof(struct upd64031a_state), GFP_KERNEL); | 233 | state = kzalloc(sizeof(struct upd64031a_state), GFP_KERNEL); |
| 234 | if (state == NULL) | 234 | if (state == NULL) |
| 235 | return -ENOMEM; | 235 | return -ENOMEM; |
| 236 | sd = &state->sd; | 236 | sd = &state->sd; |
diff --git a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c index 28e0e6b6ca84..9bbe61700fd5 100644 --- a/drivers/media/video/upd64083.c +++ b/drivers/media/video/upd64083.c | |||
| @@ -202,7 +202,7 @@ static int upd64083_probe(struct i2c_client *client, | |||
| 202 | v4l_info(client, "chip found @ 0x%x (%s)\n", | 202 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 203 | client->addr << 1, client->adapter->name); | 203 | client->addr << 1, client->adapter->name); |
| 204 | 204 | ||
| 205 | state = kmalloc(sizeof(struct upd64083_state), GFP_KERNEL); | 205 | state = kzalloc(sizeof(struct upd64083_state), GFP_KERNEL); |
| 206 | if (state == NULL) | 206 | if (state == NULL) |
| 207 | return -ENOMEM; | 207 | return -ENOMEM; |
| 208 | sd = &state->sd; | 208 | sd = &state->sd; |
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c index 5aeaf876ba9b..4aae501f02d0 100644 --- a/drivers/media/video/v4l2-device.c +++ b/drivers/media/video/v4l2-device.c | |||
| @@ -155,8 +155,10 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, | |||
| 155 | sd->v4l2_dev = v4l2_dev; | 155 | sd->v4l2_dev = v4l2_dev; |
| 156 | if (sd->internal_ops && sd->internal_ops->registered) { | 156 | if (sd->internal_ops && sd->internal_ops->registered) { |
| 157 | err = sd->internal_ops->registered(sd); | 157 | err = sd->internal_ops->registered(sd); |
| 158 | if (err) | 158 | if (err) { |
| 159 | module_put(sd->owner); | ||
| 159 | return err; | 160 | return err; |
| 161 | } | ||
| 160 | } | 162 | } |
| 161 | 163 | ||
| 162 | /* This just returns 0 if either of the two args is NULL */ | 164 | /* This just returns 0 if either of the two args is NULL */ |
| @@ -164,6 +166,7 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, | |||
| 164 | if (err) { | 166 | if (err) { |
| 165 | if (sd->internal_ops && sd->internal_ops->unregistered) | 167 | if (sd->internal_ops && sd->internal_ops->unregistered) |
| 166 | sd->internal_ops->unregistered(sd); | 168 | sd->internal_ops->unregistered(sd); |
| 169 | module_put(sd->owner); | ||
| 167 | return err; | 170 | return err; |
| 168 | } | 171 | } |
| 169 | 172 | ||
diff --git a/drivers/media/video/v4l2-subdev.c b/drivers/media/video/v4l2-subdev.c index 0b8064490676..812729ebf09e 100644 --- a/drivers/media/video/v4l2-subdev.c +++ b/drivers/media/video/v4l2-subdev.c | |||
| @@ -155,25 +155,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
| 155 | 155 | ||
| 156 | switch (cmd) { | 156 | switch (cmd) { |
| 157 | case VIDIOC_QUERYCTRL: | 157 | case VIDIOC_QUERYCTRL: |
| 158 | return v4l2_subdev_queryctrl(sd, arg); | 158 | return v4l2_queryctrl(sd->ctrl_handler, arg); |
| 159 | 159 | ||
| 160 | case VIDIOC_QUERYMENU: | 160 | case VIDIOC_QUERYMENU: |
| 161 | return v4l2_subdev_querymenu(sd, arg); | 161 | return v4l2_querymenu(sd->ctrl_handler, arg); |
| 162 | 162 | ||
| 163 | case VIDIOC_G_CTRL: | 163 | case VIDIOC_G_CTRL: |
| 164 | return v4l2_subdev_g_ctrl(sd, arg); | 164 | return v4l2_g_ctrl(sd->ctrl_handler, arg); |
| 165 | 165 | ||
| 166 | case VIDIOC_S_CTRL: | 166 | case VIDIOC_S_CTRL: |
| 167 | return v4l2_subdev_s_ctrl(sd, arg); | 167 | return v4l2_s_ctrl(sd->ctrl_handler, arg); |
| 168 | 168 | ||
| 169 | case VIDIOC_G_EXT_CTRLS: | 169 | case VIDIOC_G_EXT_CTRLS: |
| 170 | return v4l2_subdev_g_ext_ctrls(sd, arg); | 170 | return v4l2_g_ext_ctrls(sd->ctrl_handler, arg); |
| 171 | 171 | ||
| 172 | case VIDIOC_S_EXT_CTRLS: | 172 | case VIDIOC_S_EXT_CTRLS: |
| 173 | return v4l2_subdev_s_ext_ctrls(sd, arg); | 173 | return v4l2_s_ext_ctrls(sd->ctrl_handler, arg); |
| 174 | 174 | ||
| 175 | case VIDIOC_TRY_EXT_CTRLS: | 175 | case VIDIOC_TRY_EXT_CTRLS: |
| 176 | return v4l2_subdev_try_ext_ctrls(sd, arg); | 176 | return v4l2_try_ext_ctrls(sd->ctrl_handler, arg); |
| 177 | 177 | ||
| 178 | case VIDIOC_DQEVENT: | 178 | case VIDIOC_DQEVENT: |
| 179 | if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS)) | 179 | if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS)) |
