Skip to content

Commit 02214bf

Browse files
committed
Merge tag 'media/v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Mauro briefly writes: "media fixes for v4.19-rc5 some drivers and Kbuild fixes" * tag 'media/v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: platform: fix cros-ec-cec build error media: staging/media/mt9t031/Kconfig: remove bogus entry media: i2c: mt9v111: Fix v4l2-ctrl error handling media: camss: add missing includes media: camss: Use managed memory allocations media: camss: mark PM functions as __maybe_unused media: af9035: prevent buffer overflow on write media: video_function_calls.rst: drop obsolete video-set-attributes reference
2 parents 6bf4ca7 + 324493f commit 02214bf

File tree

13 files changed

+36
-46
lines changed

13 files changed

+36
-46
lines changed

Documentation/media/uapi/dvb/video_function_calls.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ Video Function Calls
3333
video-clear-buffer
3434
video-set-streamtype
3535
video-set-format
36-
video-set-attributes

drivers/media/i2c/mt9v111.c

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,48 +1159,32 @@ static int mt9v111_probe(struct i2c_client *client)
11591159
V4L2_CID_AUTO_WHITE_BALANCE,
11601160
0, 1, 1,
11611161
V4L2_WHITE_BALANCE_AUTO);
1162-
if (IS_ERR_OR_NULL(mt9v111->auto_awb)) {
1163-
ret = PTR_ERR(mt9v111->auto_awb);
1164-
goto error_free_ctrls;
1165-
}
1166-
11671162
mt9v111->auto_exp = v4l2_ctrl_new_std_menu(&mt9v111->ctrls,
11681163
&mt9v111_ctrl_ops,
11691164
V4L2_CID_EXPOSURE_AUTO,
11701165
V4L2_EXPOSURE_MANUAL,
11711166
0, V4L2_EXPOSURE_AUTO);
1172-
if (IS_ERR_OR_NULL(mt9v111->auto_exp)) {
1173-
ret = PTR_ERR(mt9v111->auto_exp);
1174-
goto error_free_ctrls;
1175-
}
1176-
1177-
/* Initialize timings */
11781167
mt9v111->hblank = v4l2_ctrl_new_std(&mt9v111->ctrls, &mt9v111_ctrl_ops,
11791168
V4L2_CID_HBLANK,
11801169
MT9V111_CORE_R05_MIN_HBLANK,
11811170
MT9V111_CORE_R05_MAX_HBLANK, 1,
11821171
MT9V111_CORE_R05_DEF_HBLANK);
1183-
if (IS_ERR_OR_NULL(mt9v111->hblank)) {
1184-
ret = PTR_ERR(mt9v111->hblank);
1185-
goto error_free_ctrls;
1186-
}
1187-
11881172
mt9v111->vblank = v4l2_ctrl_new_std(&mt9v111->ctrls, &mt9v111_ctrl_ops,
11891173
V4L2_CID_VBLANK,
11901174
MT9V111_CORE_R06_MIN_VBLANK,
11911175
MT9V111_CORE_R06_MAX_VBLANK, 1,
11921176
MT9V111_CORE_R06_DEF_VBLANK);
1193-
if (IS_ERR_OR_NULL(mt9v111->vblank)) {
1194-
ret = PTR_ERR(mt9v111->vblank);
1195-
goto error_free_ctrls;
1196-
}
11971177

11981178
/* PIXEL_RATE is fixed: just expose it to user space. */
11991179
v4l2_ctrl_new_std(&mt9v111->ctrls, &mt9v111_ctrl_ops,
12001180
V4L2_CID_PIXEL_RATE, 0,
12011181
DIV_ROUND_CLOSEST(mt9v111->sysclk, 2), 1,
12021182
DIV_ROUND_CLOSEST(mt9v111->sysclk, 2));
12031183

1184+
if (mt9v111->ctrls.error) {
1185+
ret = mt9v111->ctrls.error;
1186+
goto error_free_ctrls;
1187+
}
12041188
mt9v111->sd.ctrl_handler = &mt9v111->ctrls;
12051189

12061190
/* Start with default configuration: 640x480 UYVY. */
@@ -1226,26 +1210,27 @@ static int mt9v111_probe(struct i2c_client *client)
12261210
mt9v111->pad.flags = MEDIA_PAD_FL_SOURCE;
12271211
ret = media_entity_pads_init(&mt9v111->sd.entity, 1, &mt9v111->pad);
12281212
if (ret)
1229-
goto error_free_ctrls;
1213+
goto error_free_entity;
12301214
#endif
12311215

12321216
ret = mt9v111_chip_probe(mt9v111);
12331217
if (ret)
1234-
goto error_free_ctrls;
1218+
goto error_free_entity;
12351219

12361220
ret = v4l2_async_register_subdev(&mt9v111->sd);
12371221
if (ret)
1238-
goto error_free_ctrls;
1222+
goto error_free_entity;
12391223

12401224
return 0;
12411225

1242-
error_free_ctrls:
1243-
v4l2_ctrl_handler_free(&mt9v111->ctrls);
1244-
1226+
error_free_entity:
12451227
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
12461228
media_entity_cleanup(&mt9v111->sd.entity);
12471229
#endif
12481230

1231+
error_free_ctrls:
1232+
v4l2_ctrl_handler_free(&mt9v111->ctrls);
1233+
12491234
mutex_destroy(&mt9v111->pwr_mutex);
12501235
mutex_destroy(&mt9v111->stream_mutex);
12511236

@@ -1259,12 +1244,12 @@ static int mt9v111_remove(struct i2c_client *client)
12591244

12601245
v4l2_async_unregister_subdev(sd);
12611246

1262-
v4l2_ctrl_handler_free(&mt9v111->ctrls);
1263-
12641247
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
12651248
media_entity_cleanup(&sd->entity);
12661249
#endif
12671250

1251+
v4l2_ctrl_handler_free(&mt9v111->ctrls);
1252+
12681253
mutex_destroy(&mt9v111->pwr_mutex);
12691254
mutex_destroy(&mt9v111->stream_mutex);
12701255

drivers/media/platform/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ config VIDEO_CROS_EC_CEC
541541
depends on MFD_CROS_EC
542542
select CEC_CORE
543543
select CEC_NOTIFIER
544+
select CHROME_PLATFORMS
545+
select CROS_EC_PROTO
544546
---help---
545547
If you say yes here you will get support for the
546548
ChromeOS Embedded Controller's CEC.

drivers/media/platform/qcom/camss/camss-csid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/clk.h>
1111
#include <linux/completion.h>
1212
#include <linux/interrupt.h>
13+
#include <linux/io.h>
1314
#include <linux/kernel.h>
1415
#include <linux/of.h>
1516
#include <linux/platform_device.h>

drivers/media/platform/qcom/camss/camss-csiphy-2ph-1-0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <linux/delay.h>
1414
#include <linux/interrupt.h>
15+
#include <linux/io.h>
1516

1617
#define CAMSS_CSI_PHY_LNn_CFG2(n) (0x004 + 0x40 * (n))
1718
#define CAMSS_CSI_PHY_LNn_CFG3(n) (0x008 + 0x40 * (n))

drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <linux/delay.h>
1414
#include <linux/interrupt.h>
15+
#include <linux/io.h>
1516

1617
#define CSIPHY_3PH_LNn_CFG1(n) (0x000 + 0x100 * (n))
1718
#define CSIPHY_3PH_LNn_CFG1_SWI_REC_DLY_PRG (BIT(7) | BIT(6))

drivers/media/platform/qcom/camss/camss-csiphy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/clk.h>
1111
#include <linux/delay.h>
1212
#include <linux/interrupt.h>
13+
#include <linux/io.h>
1314
#include <linux/kernel.h>
1415
#include <linux/of.h>
1516
#include <linux/platform_device.h>

drivers/media/platform/qcom/camss/camss-ispif.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/clk.h>
1111
#include <linux/completion.h>
1212
#include <linux/interrupt.h>
13+
#include <linux/io.h>
1314
#include <linux/iopoll.h>
1415
#include <linux/kernel.h>
1516
#include <linux/mutex.h>
@@ -1076,8 +1077,8 @@ int msm_ispif_subdev_init(struct ispif_device *ispif,
10761077
else
10771078
return -EINVAL;
10781079

1079-
ispif->line = kcalloc(ispif->line_num, sizeof(*ispif->line),
1080-
GFP_KERNEL);
1080+
ispif->line = devm_kcalloc(dev, ispif->line_num, sizeof(*ispif->line),
1081+
GFP_KERNEL);
10811082
if (!ispif->line)
10821083
return -ENOMEM;
10831084

drivers/media/platform/qcom/camss/camss-vfe-4-1.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <linux/interrupt.h>
12+
#include <linux/io.h>
1213
#include <linux/iopoll.h>
1314

1415
#include "camss-vfe.h"

drivers/media/platform/qcom/camss/camss-vfe-4-7.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <linux/interrupt.h>
12+
#include <linux/io.h>
1213
#include <linux/iopoll.h>
1314

1415
#include "camss-vfe.h"

drivers/media/platform/qcom/camss/camss.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -848,17 +848,18 @@ static int camss_probe(struct platform_device *pdev)
848848
return -EINVAL;
849849
}
850850

851-
camss->csiphy = kcalloc(camss->csiphy_num, sizeof(*camss->csiphy),
852-
GFP_KERNEL);
851+
camss->csiphy = devm_kcalloc(dev, camss->csiphy_num,
852+
sizeof(*camss->csiphy), GFP_KERNEL);
853853
if (!camss->csiphy)
854854
return -ENOMEM;
855855

856-
camss->csid = kcalloc(camss->csid_num, sizeof(*camss->csid),
857-
GFP_KERNEL);
856+
camss->csid = devm_kcalloc(dev, camss->csid_num, sizeof(*camss->csid),
857+
GFP_KERNEL);
858858
if (!camss->csid)
859859
return -ENOMEM;
860860

861-
camss->vfe = kcalloc(camss->vfe_num, sizeof(*camss->vfe), GFP_KERNEL);
861+
camss->vfe = devm_kcalloc(dev, camss->vfe_num, sizeof(*camss->vfe),
862+
GFP_KERNEL);
862863
if (!camss->vfe)
863864
return -ENOMEM;
864865

@@ -993,12 +994,12 @@ static const struct of_device_id camss_dt_match[] = {
993994

994995
MODULE_DEVICE_TABLE(of, camss_dt_match);
995996

996-
static int camss_runtime_suspend(struct device *dev)
997+
static int __maybe_unused camss_runtime_suspend(struct device *dev)
997998
{
998999
return 0;
9991000
}
10001001

1001-
static int camss_runtime_resume(struct device *dev)
1002+
static int __maybe_unused camss_runtime_resume(struct device *dev)
10021003
{
10031004
return 0;
10041005
}

drivers/media/usb/dvb-usb-v2/af9035.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,10 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
402402
if (msg[0].addr == state->af9033_i2c_addr[1])
403403
reg |= 0x100000;
404404

405-
ret = af9035_wr_regs(d, reg, &msg[0].buf[3],
406-
msg[0].len - 3);
405+
ret = (msg[0].len >= 3) ? af9035_wr_regs(d, reg,
406+
&msg[0].buf[3],
407+
msg[0].len - 3)
408+
: -EOPNOTSUPP;
407409
} else {
408410
/* I2C write */
409411
u8 buf[MAX_XFER_SIZE];

drivers/staging/media/mt9t031/Kconfig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
config SOC_CAMERA_IMX074
2-
tristate "imx074 support (DEPRECATED)"
3-
depends on SOC_CAMERA && I2C
4-
help
5-
This driver supports IMX074 cameras from Sony
6-
71
config SOC_CAMERA_MT9T031
82
tristate "mt9t031 support (DEPRECATED)"
93
depends on SOC_CAMERA && I2C

0 commit comments

Comments
 (0)