diff options
Diffstat (limited to 'drivers/media')
30 files changed, 80 insertions, 70 deletions
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c index 68f768a5422d..a6c3c9e2e897 100644 --- a/drivers/media/dvb-frontends/cx24117.c +++ b/drivers/media/dvb-frontends/cx24117.c | |||
@@ -1176,7 +1176,7 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, | |||
1176 | 1176 | ||
1177 | switch (demod) { | 1177 | switch (demod) { |
1178 | case 0: | 1178 | case 0: |
1179 | dev_err(&state->priv->i2c->dev, | 1179 | dev_err(&i2c->dev, |
1180 | "%s: Error attaching frontend %d\n", | 1180 | "%s: Error attaching frontend %d\n", |
1181 | KBUILD_MODNAME, demod); | 1181 | KBUILD_MODNAME, demod); |
1182 | goto error1; | 1182 | goto error1; |
@@ -1200,12 +1200,6 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, | |||
1200 | state->demod = demod - 1; | 1200 | state->demod = demod - 1; |
1201 | state->priv = priv; | 1201 | state->priv = priv; |
1202 | 1202 | ||
1203 | /* test i2c bus for ack */ | ||
1204 | if (demod == 0) { | ||
1205 | if (cx24117_readreg(state, 0x00) < 0) | ||
1206 | goto error3; | ||
1207 | } | ||
1208 | |||
1209 | dev_info(&state->priv->i2c->dev, | 1203 | dev_info(&state->priv->i2c->dev, |
1210 | "%s: Attaching frontend %d\n", | 1204 | "%s: Attaching frontend %d\n", |
1211 | KBUILD_MODNAME, state->demod); | 1205 | KBUILD_MODNAME, state->demod); |
@@ -1216,8 +1210,6 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config, | |||
1216 | state->frontend.demodulator_priv = state; | 1210 | state->frontend.demodulator_priv = state; |
1217 | return &state->frontend; | 1211 | return &state->frontend; |
1218 | 1212 | ||
1219 | error3: | ||
1220 | kfree(state); | ||
1221 | error2: | 1213 | error2: |
1222 | cx24117_release_priv(priv); | 1214 | cx24117_release_priv(priv); |
1223 | error1: | 1215 | error1: |
diff --git a/drivers/media/dvb-frontends/nxt200x.c b/drivers/media/dvb-frontends/nxt200x.c index 4bf057544607..8a8e1ecb762d 100644 --- a/drivers/media/dvb-frontends/nxt200x.c +++ b/drivers/media/dvb-frontends/nxt200x.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Support for NXT2002 and NXT2004 - VSB/QAM | 2 | * Support for NXT2002 and NXT2004 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Kirk Lapray <kirk.lapray@gmail.com> | 4 | * Copyright (C) 2005 Kirk Lapray <kirk.lapray@gmail.com> |
5 | * Copyright (C) 2006 Michael Krufky <mkrufky@m1k.net> | 5 | * Copyright (C) 2006-2014 Michael Krufky <mkrufky@linuxtv.org> |
6 | * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net> | 6 | * based on nxt2002 by Taylor Jacob <rtjacob@earthlink.net> |
7 | * and nxt2004 by Jean-Francois Thibert <jeanfrancois@sagetv.com> | 7 | * and nxt2004 by Jean-Francois Thibert <jeanfrancois@sagetv.com> |
8 | * | 8 | * |
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index 1effc21e1cdd..9bbd6656fb8f 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c | |||
@@ -2554,7 +2554,7 @@ static int adv7842_core_init(struct v4l2_subdev *sd) | |||
2554 | sdp_write_and_or(sd, 0xdd, 0xf0, pdata->sdp_free_run_force | | 2554 | sdp_write_and_or(sd, 0xdd, 0xf0, pdata->sdp_free_run_force | |
2555 | (pdata->sdp_free_run_cbar_en << 1) | | 2555 | (pdata->sdp_free_run_cbar_en << 1) | |
2556 | (pdata->sdp_free_run_man_col_en << 2) | | 2556 | (pdata->sdp_free_run_man_col_en << 2) | |
2557 | (pdata->sdp_free_run_force << 3)); | 2557 | (pdata->sdp_free_run_auto << 3)); |
2558 | 2558 | ||
2559 | /* TODO from platform data */ | 2559 | /* TODO from platform data */ |
2560 | cp_write(sd, 0x69, 0x14); /* Enable CP CSC */ | 2560 | cp_write(sd, 0x69, 0x14); /* Enable CP CSC */ |
diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index 4b8381111cbd..77e10e0fd8d6 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c | |||
@@ -478,25 +478,33 @@ static void s5k5baf_write_arr_seq(struct s5k5baf *state, u16 addr, | |||
478 | u16 count, const u16 *seq) | 478 | u16 count, const u16 *seq) |
479 | { | 479 | { |
480 | struct i2c_client *c = v4l2_get_subdevdata(&state->sd); | 480 | struct i2c_client *c = v4l2_get_subdevdata(&state->sd); |
481 | __be16 buf[count + 1]; | 481 | __be16 buf[65]; |
482 | int ret, n; | ||
483 | 482 | ||
484 | s5k5baf_i2c_write(state, REG_CMDWR_ADDR, addr); | 483 | s5k5baf_i2c_write(state, REG_CMDWR_ADDR, addr); |
485 | if (state->error) | 484 | if (state->error) |
486 | return; | 485 | return; |
487 | 486 | ||
487 | v4l2_dbg(3, debug, c, "i2c_write_seq(count=%d): %*ph\n", count, | ||
488 | min(2 * count, 64), seq); | ||
489 | |||
488 | buf[0] = __constant_cpu_to_be16(REG_CMD_BUF); | 490 | buf[0] = __constant_cpu_to_be16(REG_CMD_BUF); |
489 | for (n = 1; n <= count; ++n) | ||
490 | buf[n] = cpu_to_be16(*seq++); | ||
491 | 491 | ||
492 | n *= 2; | 492 | while (count > 0) { |
493 | ret = i2c_master_send(c, (char *)buf, n); | 493 | int n = min_t(int, count, ARRAY_SIZE(buf) - 1); |
494 | v4l2_dbg(3, debug, c, "i2c_write_seq(count=%d): %*ph\n", count, | 494 | int ret, i; |
495 | min(2 * count, 64), seq - count); | ||
496 | 495 | ||
497 | if (ret != n) { | 496 | for (i = 1; i <= n; ++i) |
498 | v4l2_err(c, "i2c_write_seq: error during transfer (%d)\n", ret); | 497 | buf[i] = cpu_to_be16(*seq++); |
499 | state->error = ret; | 498 | |
499 | i *= 2; | ||
500 | ret = i2c_master_send(c, (char *)buf, i); | ||
501 | if (ret != i) { | ||
502 | v4l2_err(c, "i2c_write_seq: error during transfer (%d)\n", ret); | ||
503 | state->error = ret; | ||
504 | break; | ||
505 | } | ||
506 | |||
507 | count -= n; | ||
500 | } | 508 | } |
501 | } | 509 | } |
502 | 510 | ||
diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c index d85cb0ace4dc..6662b495b22c 100644 --- a/drivers/media/pci/bt8xx/bttv-cards.c +++ b/drivers/media/pci/bt8xx/bttv-cards.c | |||
@@ -2426,7 +2426,7 @@ struct tvcard bttv_tvcards[] = { | |||
2426 | }, | 2426 | }, |
2427 | /* ---- card 0x87---------------------------------- */ | 2427 | /* ---- card 0x87---------------------------------- */ |
2428 | [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = { | 2428 | [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = { |
2429 | /* Michael Krufky <mkrufky@m1k.net> */ | 2429 | /* Michael Krufky <mkrufky@linuxtv.org> */ |
2430 | .name = "DViCO FusionHDTV 5 Lite", | 2430 | .name = "DViCO FusionHDTV 5 Lite", |
2431 | .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */ | 2431 | .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */ |
2432 | .tuner_addr = ADDR_UNSET, | 2432 | .tuner_addr = ADDR_UNSET, |
diff --git a/drivers/media/pci/bt8xx/bttv-gpio.c b/drivers/media/pci/bt8xx/bttv-gpio.c index 922e8233fd0b..3f364b7062b9 100644 --- a/drivers/media/pci/bt8xx/bttv-gpio.c +++ b/drivers/media/pci/bt8xx/bttv-gpio.c | |||
@@ -98,7 +98,7 @@ int bttv_sub_add_device(struct bttv_core *core, char *name) | |||
98 | 98 | ||
99 | err = device_register(&sub->dev); | 99 | err = device_register(&sub->dev); |
100 | if (0 != err) { | 100 | if (0 != err) { |
101 | kfree(sub); | 101 | put_device(&sub->dev); |
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev)); | 104 | pr_info("%d: add subdevice \"%s\"\n", core->nr, dev_name(&sub->dev)); |
diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c index d45e7f6ff332..c9b2350e92c8 100644 --- a/drivers/media/pci/saa7134/saa7134-cards.c +++ b/drivers/media/pci/saa7134/saa7134-cards.c | |||
@@ -2590,7 +2590,7 @@ struct saa7134_board saa7134_boards[] = { | |||
2590 | }}, | 2590 | }}, |
2591 | }, | 2591 | }, |
2592 | [SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180] = { | 2592 | [SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180] = { |
2593 | /* Michael Krufky <mkrufky@m1k.net> | 2593 | /* Michael Krufky <mkrufky@linuxtv.org> |
2594 | * Uses Alps Electric TDHU2, containing NXT2004 ATSC Decoder | 2594 | * Uses Alps Electric TDHU2, containing NXT2004 ATSC Decoder |
2595 | * AFAIK, there is no analog demod, thus, | 2595 | * AFAIK, there is no analog demod, thus, |
2596 | * no support for analog television. | 2596 | * no support for analog television. |
diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index a7dfd07e8389..da2fc86cc524 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c | |||
@@ -1027,7 +1027,8 @@ static int fimc_probe(struct platform_device *pdev) | |||
1027 | return 0; | 1027 | return 0; |
1028 | 1028 | ||
1029 | err_gclk: | 1029 | err_gclk: |
1030 | clk_disable(fimc->clock[CLK_GATE]); | 1030 | if (!pm_runtime_enabled(dev)) |
1031 | clk_disable(fimc->clock[CLK_GATE]); | ||
1031 | err_sd: | 1032 | err_sd: |
1032 | fimc_unregister_capture_subdev(fimc); | 1033 | fimc_unregister_capture_subdev(fimc); |
1033 | err_sclk: | 1034 | err_sclk: |
@@ -1036,6 +1037,7 @@ err_sclk: | |||
1036 | return ret; | 1037 | return ret; |
1037 | } | 1038 | } |
1038 | 1039 | ||
1040 | #ifdef CONFIG_PM_RUNTIME | ||
1039 | static int fimc_runtime_resume(struct device *dev) | 1041 | static int fimc_runtime_resume(struct device *dev) |
1040 | { | 1042 | { |
1041 | struct fimc_dev *fimc = dev_get_drvdata(dev); | 1043 | struct fimc_dev *fimc = dev_get_drvdata(dev); |
@@ -1068,6 +1070,7 @@ static int fimc_runtime_suspend(struct device *dev) | |||
1068 | dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state); | 1070 | dbg("fimc%d: state: 0x%lx", fimc->id, fimc->state); |
1069 | return ret; | 1071 | return ret; |
1070 | } | 1072 | } |
1073 | #endif | ||
1071 | 1074 | ||
1072 | #ifdef CONFIG_PM_SLEEP | 1075 | #ifdef CONFIG_PM_SLEEP |
1073 | static int fimc_resume(struct device *dev) | 1076 | static int fimc_resume(struct device *dev) |
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index 1234734bccf4..779ec3cd259d 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c | |||
@@ -1563,7 +1563,7 @@ static int fimc_lite_probe(struct platform_device *pdev) | |||
1563 | if (!pm_runtime_enabled(dev)) { | 1563 | if (!pm_runtime_enabled(dev)) { |
1564 | ret = clk_enable(fimc->clock); | 1564 | ret = clk_enable(fimc->clock); |
1565 | if (ret < 0) | 1565 | if (ret < 0) |
1566 | goto err_clk_put; | 1566 | goto err_sd; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev); | 1569 | fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev); |
@@ -1579,7 +1579,8 @@ static int fimc_lite_probe(struct platform_device *pdev) | |||
1579 | return 0; | 1579 | return 0; |
1580 | 1580 | ||
1581 | err_clk_dis: | 1581 | err_clk_dis: |
1582 | clk_disable(fimc->clock); | 1582 | if (!pm_runtime_enabled(dev)) |
1583 | clk_disable(fimc->clock); | ||
1583 | err_sd: | 1584 | err_sd: |
1584 | fimc_lite_unregister_capture_subdev(fimc); | 1585 | fimc_lite_unregister_capture_subdev(fimc); |
1585 | err_clk_put: | 1586 | err_clk_put: |
@@ -1587,6 +1588,7 @@ err_clk_put: | |||
1587 | return ret; | 1588 | return ret; |
1588 | } | 1589 | } |
1589 | 1590 | ||
1591 | #ifdef CONFIG_PM_RUNTIME | ||
1590 | static int fimc_lite_runtime_resume(struct device *dev) | 1592 | static int fimc_lite_runtime_resume(struct device *dev) |
1591 | { | 1593 | { |
1592 | struct fimc_lite *fimc = dev_get_drvdata(dev); | 1594 | struct fimc_lite *fimc = dev_get_drvdata(dev); |
@@ -1602,6 +1604,7 @@ static int fimc_lite_runtime_suspend(struct device *dev) | |||
1602 | clk_disable(fimc->clock); | 1604 | clk_disable(fimc->clock); |
1603 | return 0; | 1605 | return 0; |
1604 | } | 1606 | } |
1607 | #endif | ||
1605 | 1608 | ||
1606 | #ifdef CONFIG_PM_SLEEP | 1609 | #ifdef CONFIG_PM_SLEEP |
1607 | static int fimc_lite_resume(struct device *dev) | 1610 | static int fimc_lite_resume(struct device *dev) |
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index a1c78c870b68..7d68d0b9966a 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c | |||
@@ -175,7 +175,7 @@ static struct s5p_jpeg_fmt sjpeg_formats[] = { | |||
175 | { | 175 | { |
176 | .name = "YUV 4:2:0 planar, Y/CbCr", | 176 | .name = "YUV 4:2:0 planar, Y/CbCr", |
177 | .fourcc = V4L2_PIX_FMT_NV12, | 177 | .fourcc = V4L2_PIX_FMT_NV12, |
178 | .depth = 16, | 178 | .depth = 12, |
179 | .colplanes = 2, | 179 | .colplanes = 2, |
180 | .h_align = 1, | 180 | .h_align = 1, |
181 | .v_align = 1, | 181 | .v_align = 1, |
@@ -188,10 +188,10 @@ static struct s5p_jpeg_fmt sjpeg_formats[] = { | |||
188 | { | 188 | { |
189 | .name = "YUV 4:2:0 planar, Y/CbCr", | 189 | .name = "YUV 4:2:0 planar, Y/CbCr", |
190 | .fourcc = V4L2_PIX_FMT_NV12, | 190 | .fourcc = V4L2_PIX_FMT_NV12, |
191 | .depth = 16, | 191 | .depth = 12, |
192 | .colplanes = 4, | 192 | .colplanes = 2, |
193 | .h_align = 4, | 193 | .h_align = 4, |
194 | .v_align = 1, | 194 | .v_align = 4, |
195 | .flags = SJPEG_FMT_FLAG_ENC_OUTPUT | | 195 | .flags = SJPEG_FMT_FLAG_ENC_OUTPUT | |
196 | SJPEG_FMT_FLAG_DEC_CAPTURE | | 196 | SJPEG_FMT_FLAG_DEC_CAPTURE | |
197 | SJPEG_FMT_FLAG_S5P | | 197 | SJPEG_FMT_FLAG_S5P | |
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 8f9b2cea88f0..8ede8ea762e6 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -1539,6 +1539,8 @@ static const struct usb_device_id af9035_id_table[] = { | |||
1539 | &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) }, | 1539 | &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) }, |
1540 | { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a05, | 1540 | { DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a05, |
1541 | &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, | 1541 | &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, |
1542 | { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900, | ||
1543 | &af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) }, | ||
1542 | { } | 1544 | { } |
1543 | }; | 1545 | }; |
1544 | MODULE_DEVICE_TABLE(usb, af9035_id_table); | 1546 | MODULE_DEVICE_TABLE(usb, af9035_id_table); |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c index d83df4bb72d3..0a98d04c53e4 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-demod.c - driver for the MaxLinear MXL111SF DVB-T demodulator | 2 | * mxl111sf-demod.c - driver for the MaxLinear MXL111SF DVB-T demodulator |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -601,7 +601,7 @@ struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state, | |||
601 | EXPORT_SYMBOL_GPL(mxl111sf_demod_attach); | 601 | EXPORT_SYMBOL_GPL(mxl111sf_demod_attach); |
602 | 602 | ||
603 | MODULE_DESCRIPTION("MaxLinear MxL111SF DVB-T demodulator driver"); | 603 | MODULE_DESCRIPTION("MaxLinear MxL111SF DVB-T demodulator driver"); |
604 | MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); | 604 | MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); |
605 | MODULE_LICENSE("GPL"); | 605 | MODULE_LICENSE("GPL"); |
606 | MODULE_VERSION("0.1"); | 606 | MODULE_VERSION("0.1"); |
607 | 607 | ||
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h index 3f3f8bfd190b..2d4530f5be54 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-demod.h - driver for the MaxLinear MXL111SF DVB-T demodulator | 2 | * mxl111sf-demod.h - driver for the MaxLinear MXL111SF DVB-T demodulator |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c index e4121cb8f5ef..a619410adde4 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-gpio.c - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-gpio.c - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h index 0220f54299a5..b85a5772d771 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-gpio.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-gpio.h - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-gpio.h - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c index 34434557ef65..a101d06eb143 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-i2c.c - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-i2c.c - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.h b/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.h index a57a45ffb9e4..465762145ad2 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-i2c.h - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-i2c.h - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.c index b741b3a7a325..f6b348024bec 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-phy.c - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-phy.c - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.h b/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.h index f0756071d347..0643738de7de 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-phy.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-phy.h - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-phy.h - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-reg.h b/drivers/media/usb/dvb-usb-v2/mxl111sf-reg.h index 17831b0fb9db..89bf115e927e 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-reg.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-reg.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-reg.h - driver for the MaxLinear MXL111SF | 2 | * mxl111sf-reg.h - driver for the MaxLinear MXL111SF |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c index 879c529640f7..a8d2c7053674 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-tuner.c - driver for the MaxLinear MXL111SF CMOS tuner | 2 | * mxl111sf-tuner.c - driver for the MaxLinear MXL111SF CMOS tuner |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -512,7 +512,7 @@ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe, | |||
512 | EXPORT_SYMBOL_GPL(mxl111sf_tuner_attach); | 512 | EXPORT_SYMBOL_GPL(mxl111sf_tuner_attach); |
513 | 513 | ||
514 | MODULE_DESCRIPTION("MaxLinear MxL111SF CMOS tuner driver"); | 514 | MODULE_DESCRIPTION("MaxLinear MxL111SF CMOS tuner driver"); |
515 | MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); | 515 | MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); |
516 | MODULE_LICENSE("GPL"); | 516 | MODULE_LICENSE("GPL"); |
517 | MODULE_VERSION("0.1"); | 517 | MODULE_VERSION("0.1"); |
518 | 518 | ||
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h index 90f583e5d6a6..2046db22519e 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mxl111sf-tuner.h - driver for the MaxLinear MXL111SF CMOS tuner | 2 | * mxl111sf-tuner.h - driver for the MaxLinear MXL111SF CMOS tuner |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com> | 4 | * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -68,7 +68,7 @@ struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe, | |||
68 | #else | 68 | #else |
69 | static inline | 69 | static inline |
70 | struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe, | 70 | struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe, |
71 | struct mxl111sf_state *mxl_state | 71 | struct mxl111sf_state *mxl_state, |
72 | struct mxl111sf_tuner_config *cfg) | 72 | struct mxl111sf_tuner_config *cfg) |
73 | { | 73 | { |
74 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | 74 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c index 08240e498451..c7304fa8ab73 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2010 Michael Krufky (mkrufky@kernellabs.com) | 2 | * Copyright (C) 2010-2014 Michael Krufky (mkrufky@linuxtv.org) |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of the GNU General Public License as published by the Free | 5 | * under the terms of the GNU General Public License as published by the Free |
@@ -105,7 +105,7 @@ int mxl111sf_read_reg(struct mxl111sf_state *state, u8 addr, u8 *data) | |||
105 | ret = -EINVAL; | 105 | ret = -EINVAL; |
106 | } | 106 | } |
107 | 107 | ||
108 | pr_debug("R: (0x%02x, 0x%02x)\n", addr, *data); | 108 | pr_debug("R: (0x%02x, 0x%02x)\n", addr, buf[1]); |
109 | fail: | 109 | fail: |
110 | return ret; | 110 | return ret; |
111 | } | 111 | } |
@@ -1421,7 +1421,7 @@ static struct usb_driver mxl111sf_usb_driver = { | |||
1421 | 1421 | ||
1422 | module_usb_driver(mxl111sf_usb_driver); | 1422 | module_usb_driver(mxl111sf_usb_driver); |
1423 | 1423 | ||
1424 | MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); | 1424 | MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); |
1425 | MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF"); | 1425 | MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF"); |
1426 | MODULE_VERSION("1.0"); | 1426 | MODULE_VERSION("1.0"); |
1427 | MODULE_LICENSE("GPL"); | 1427 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.h b/drivers/media/usb/dvb-usb-v2/mxl111sf.h index 9816de86e48c..8516c011b7cc 100644 --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.h +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2010 Michael Krufky (mkrufky@kernellabs.com) | 2 | * Copyright (C) 2010-2014 Michael Krufky (mkrufky@linuxtv.org) |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of the GNU General Public License as published by the Free | 5 | * under the terms of the GNU General Public License as published by the Free |
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index 2f0c89cbac76..c5638964c3f2 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c | |||
@@ -198,7 +198,6 @@ static int device_authorization(struct hdpvr_device *dev) | |||
198 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, 5*buf_size+1, 0); | 198 | hex_dump_to_buffer(response, 8, 16, 1, print_buf, 5*buf_size+1, 0); |
199 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, " response: %s\n", | 199 | v4l2_dbg(MSG_INFO, hdpvr_debug, &dev->v4l2_dev, " response: %s\n", |
200 | print_buf); | 200 | print_buf); |
201 | kfree(print_buf); | ||
202 | #endif | 201 | #endif |
203 | 202 | ||
204 | msleep(100); | 203 | msleep(100); |
@@ -214,6 +213,9 @@ static int device_authorization(struct hdpvr_device *dev) | |||
214 | retval = ret != 8; | 213 | retval = ret != 8; |
215 | unlock: | 214 | unlock: |
216 | mutex_unlock(&dev->usbc_mutex); | 215 | mutex_unlock(&dev->usbc_mutex); |
216 | #ifdef HDPVR_DEBUG | ||
217 | kfree(print_buf); | ||
218 | #endif | ||
217 | return retval; | 219 | return retval; |
218 | } | 220 | } |
219 | 221 | ||
diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b/drivers/media/v4l2-core/v4l2-dv-timings.c index ee52b9f4a944..f7902fe8a526 100644 --- a/drivers/media/v4l2-core/v4l2-dv-timings.c +++ b/drivers/media/v4l2-core/v4l2-dv-timings.c | |||
@@ -515,6 +515,7 @@ bool v4l2_detect_gtf(unsigned frame_height, | |||
515 | aspect.denominator = 9; | 515 | aspect.denominator = 9; |
516 | } | 516 | } |
517 | image_width = ((image_height * aspect.numerator) / aspect.denominator); | 517 | image_width = ((image_height * aspect.numerator) / aspect.denominator); |
518 | image_width = (image_width + GTF_CELL_GRAN/2) & ~(GTF_CELL_GRAN - 1); | ||
518 | 519 | ||
519 | /* Horizontal */ | 520 | /* Horizontal */ |
520 | if (default_gtf) | 521 | if (default_gtf) |
diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c index 65411adcd0ea..7e6b209b7002 100644 --- a/drivers/media/v4l2-core/videobuf-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf-dma-contig.c | |||
@@ -66,14 +66,11 @@ static void __videobuf_dc_free(struct device *dev, | |||
66 | static void videobuf_vm_open(struct vm_area_struct *vma) | 66 | static void videobuf_vm_open(struct vm_area_struct *vma) |
67 | { | 67 | { |
68 | struct videobuf_mapping *map = vma->vm_private_data; | 68 | struct videobuf_mapping *map = vma->vm_private_data; |
69 | struct videobuf_queue *q = map->q; | ||
70 | 69 | ||
71 | dev_dbg(q->dev, "vm_open %p [count=%u,vma=%08lx-%08lx]\n", | 70 | dev_dbg(map->q->dev, "vm_open %p [count=%u,vma=%08lx-%08lx]\n", |
72 | map, map->count, vma->vm_start, vma->vm_end); | 71 | map, map->count, vma->vm_start, vma->vm_end); |
73 | 72 | ||
74 | videobuf_queue_lock(q); | ||
75 | map->count++; | 73 | map->count++; |
76 | videobuf_queue_unlock(q); | ||
77 | } | 74 | } |
78 | 75 | ||
79 | static void videobuf_vm_close(struct vm_area_struct *vma) | 76 | static void videobuf_vm_close(struct vm_area_struct *vma) |
@@ -85,11 +82,12 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
85 | dev_dbg(q->dev, "vm_close %p [count=%u,vma=%08lx-%08lx]\n", | 82 | dev_dbg(q->dev, "vm_close %p [count=%u,vma=%08lx-%08lx]\n", |
86 | map, map->count, vma->vm_start, vma->vm_end); | 83 | map, map->count, vma->vm_start, vma->vm_end); |
87 | 84 | ||
88 | videobuf_queue_lock(q); | 85 | map->count--; |
89 | if (!--map->count) { | 86 | if (0 == map->count) { |
90 | struct videobuf_dma_contig_memory *mem; | 87 | struct videobuf_dma_contig_memory *mem; |
91 | 88 | ||
92 | dev_dbg(q->dev, "munmap %p q=%p\n", map, q); | 89 | dev_dbg(q->dev, "munmap %p q=%p\n", map, q); |
90 | videobuf_queue_lock(q); | ||
93 | 91 | ||
94 | /* We need first to cancel streams, before unmapping */ | 92 | /* We need first to cancel streams, before unmapping */ |
95 | if (q->streaming) | 93 | if (q->streaming) |
@@ -128,8 +126,8 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
128 | 126 | ||
129 | kfree(map); | 127 | kfree(map); |
130 | 128 | ||
129 | videobuf_queue_unlock(q); | ||
131 | } | 130 | } |
132 | videobuf_queue_unlock(q); | ||
133 | } | 131 | } |
134 | 132 | ||
135 | static const struct vm_operations_struct videobuf_vm_ops = { | 133 | static const struct vm_operations_struct videobuf_vm_ops = { |
diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c index 9db674ccdc68..828e7c10bd70 100644 --- a/drivers/media/v4l2-core/videobuf-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf-dma-sg.c | |||
@@ -338,14 +338,11 @@ EXPORT_SYMBOL_GPL(videobuf_dma_free); | |||
338 | static void videobuf_vm_open(struct vm_area_struct *vma) | 338 | static void videobuf_vm_open(struct vm_area_struct *vma) |
339 | { | 339 | { |
340 | struct videobuf_mapping *map = vma->vm_private_data; | 340 | struct videobuf_mapping *map = vma->vm_private_data; |
341 | struct videobuf_queue *q = map->q; | ||
342 | 341 | ||
343 | dprintk(2, "vm_open %p [count=%d,vma=%08lx-%08lx]\n", map, | 342 | dprintk(2, "vm_open %p [count=%d,vma=%08lx-%08lx]\n", map, |
344 | map->count, vma->vm_start, vma->vm_end); | 343 | map->count, vma->vm_start, vma->vm_end); |
345 | 344 | ||
346 | videobuf_queue_lock(q); | ||
347 | map->count++; | 345 | map->count++; |
348 | videobuf_queue_unlock(q); | ||
349 | } | 346 | } |
350 | 347 | ||
351 | static void videobuf_vm_close(struct vm_area_struct *vma) | 348 | static void videobuf_vm_close(struct vm_area_struct *vma) |
@@ -358,9 +355,10 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
358 | dprintk(2, "vm_close %p [count=%d,vma=%08lx-%08lx]\n", map, | 355 | dprintk(2, "vm_close %p [count=%d,vma=%08lx-%08lx]\n", map, |
359 | map->count, vma->vm_start, vma->vm_end); | 356 | map->count, vma->vm_start, vma->vm_end); |
360 | 357 | ||
361 | videobuf_queue_lock(q); | 358 | map->count--; |
362 | if (!--map->count) { | 359 | if (0 == map->count) { |
363 | dprintk(1, "munmap %p q=%p\n", map, q); | 360 | dprintk(1, "munmap %p q=%p\n", map, q); |
361 | videobuf_queue_lock(q); | ||
364 | for (i = 0; i < VIDEO_MAX_FRAME; i++) { | 362 | for (i = 0; i < VIDEO_MAX_FRAME; i++) { |
365 | if (NULL == q->bufs[i]) | 363 | if (NULL == q->bufs[i]) |
366 | continue; | 364 | continue; |
@@ -376,9 +374,9 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
376 | q->bufs[i]->baddr = 0; | 374 | q->bufs[i]->baddr = 0; |
377 | q->ops->buf_release(q, q->bufs[i]); | 375 | q->ops->buf_release(q, q->bufs[i]); |
378 | } | 376 | } |
377 | videobuf_queue_unlock(q); | ||
379 | kfree(map); | 378 | kfree(map); |
380 | } | 379 | } |
381 | videobuf_queue_unlock(q); | ||
382 | return; | 380 | return; |
383 | } | 381 | } |
384 | 382 | ||
diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c index 1365c651c177..2ff7fcc77b11 100644 --- a/drivers/media/v4l2-core/videobuf-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf-vmalloc.c | |||
@@ -54,14 +54,11 @@ MODULE_LICENSE("GPL"); | |||
54 | static void videobuf_vm_open(struct vm_area_struct *vma) | 54 | static void videobuf_vm_open(struct vm_area_struct *vma) |
55 | { | 55 | { |
56 | struct videobuf_mapping *map = vma->vm_private_data; | 56 | struct videobuf_mapping *map = vma->vm_private_data; |
57 | struct videobuf_queue *q = map->q; | ||
58 | 57 | ||
59 | dprintk(2, "vm_open %p [count=%u,vma=%08lx-%08lx]\n", map, | 58 | dprintk(2, "vm_open %p [count=%u,vma=%08lx-%08lx]\n", map, |
60 | map->count, vma->vm_start, vma->vm_end); | 59 | map->count, vma->vm_start, vma->vm_end); |
61 | 60 | ||
62 | videobuf_queue_lock(q); | ||
63 | map->count++; | 61 | map->count++; |
64 | videobuf_queue_unlock(q); | ||
65 | } | 62 | } |
66 | 63 | ||
67 | static void videobuf_vm_close(struct vm_area_struct *vma) | 64 | static void videobuf_vm_close(struct vm_area_struct *vma) |
@@ -73,11 +70,12 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
73 | dprintk(2, "vm_close %p [count=%u,vma=%08lx-%08lx]\n", map, | 70 | dprintk(2, "vm_close %p [count=%u,vma=%08lx-%08lx]\n", map, |
74 | map->count, vma->vm_start, vma->vm_end); | 71 | map->count, vma->vm_start, vma->vm_end); |
75 | 72 | ||
76 | videobuf_queue_lock(q); | 73 | map->count--; |
77 | if (!--map->count) { | 74 | if (0 == map->count) { |
78 | struct videobuf_vmalloc_memory *mem; | 75 | struct videobuf_vmalloc_memory *mem; |
79 | 76 | ||
80 | dprintk(1, "munmap %p q=%p\n", map, q); | 77 | dprintk(1, "munmap %p q=%p\n", map, q); |
78 | videobuf_queue_lock(q); | ||
81 | 79 | ||
82 | /* We need first to cancel streams, before unmapping */ | 80 | /* We need first to cancel streams, before unmapping */ |
83 | if (q->streaming) | 81 | if (q->streaming) |
@@ -116,8 +114,8 @@ static void videobuf_vm_close(struct vm_area_struct *vma) | |||
116 | 114 | ||
117 | kfree(map); | 115 | kfree(map); |
118 | 116 | ||
117 | videobuf_queue_unlock(q); | ||
119 | } | 118 | } |
120 | videobuf_queue_unlock(q); | ||
121 | 119 | ||
122 | return; | 120 | return; |
123 | } | 121 | } |
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 5a5fb7f09b7b..a127925c9d61 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c | |||
@@ -1776,6 +1776,11 @@ static int vb2_internal_streamon(struct vb2_queue *q, enum v4l2_buf_type type) | |||
1776 | return 0; | 1776 | return 0; |
1777 | } | 1777 | } |
1778 | 1778 | ||
1779 | if (!q->num_buffers) { | ||
1780 | dprintk(1, "streamon: no buffers have been allocated\n"); | ||
1781 | return -EINVAL; | ||
1782 | } | ||
1783 | |||
1779 | /* | 1784 | /* |
1780 | * If any buffers were queued before streamon, | 1785 | * If any buffers were queued before streamon, |
1781 | * we can now pass them to driver for processing. | 1786 | * we can now pass them to driver for processing. |