Skip to content

Commit aa9ea98

Browse files
committed
Merge tag 'media/v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "Three driver fixes" * tag 'media/v6.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: imx: imx7-media-csi: Fix applying format constraints media: uvcvideo: Fix menu count handling for userspace XU mappings media: mtk-jpeg: Set platform driver data earlier
2 parents bf98bae + 2908042 commit aa9ea98

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,8 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
13101310
jpeg->dev = &pdev->dev;
13111311
jpeg->variant = of_device_get_match_data(jpeg->dev);
13121312

1313+
platform_set_drvdata(pdev, jpeg);
1314+
13131315
ret = devm_of_platform_populate(&pdev->dev);
13141316
if (ret) {
13151317
v4l2_err(&jpeg->v4l2_dev, "Master of platform populate failed.");
@@ -1381,8 +1383,6 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
13811383
jpeg->variant->dev_name, jpeg->vdev->num,
13821384
VIDEO_MAJOR, jpeg->vdev->minor);
13831385

1384-
platform_set_drvdata(pdev, jpeg);
1385-
13861386
pm_runtime_enable(&pdev->dev);
13871387

13881388
return 0;

drivers/media/platform/nxp/imx7-media-csi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
#include <linux/clk.h>
1010
#include <linux/delay.h>
1111
#include <linux/interrupt.h>
12+
#include <linux/math.h>
1213
#include <linux/mfd/syscon.h>
14+
#include <linux/minmax.h>
1315
#include <linux/module.h>
1416
#include <linux/of_device.h>
1517
#include <linux/of_graph.h>
@@ -1137,8 +1139,9 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
11371139
* TODO: Implement configurable stride support.
11381140
*/
11391141
walign = 8 * 8 / cc->bpp;
1140-
v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign,
1141-
&pixfmt->height, 1, 0xffff, 1, 0);
1142+
pixfmt->width = clamp(round_up(pixfmt->width, walign), walign,
1143+
round_down(65535U, walign));
1144+
pixfmt->height = clamp(pixfmt->height, 1U, 65535U);
11421145

11431146
pixfmt->bytesperline = pixfmt->width * cc->bpp / 8;
11441147
pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;

drivers/media/usb/uvc/uvc_v4l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int uvc_control_add_xu_mapping(struct uvc_video_chain *chain,
4545
map->menu_names = NULL;
4646
map->menu_mapping = NULL;
4747

48-
map->menu_mask = BIT_MASK(xmap->menu_count);
48+
map->menu_mask = GENMASK(xmap->menu_count - 1, 0);
4949

5050
size = xmap->menu_count * sizeof(*map->menu_mapping);
5151
map->menu_mapping = kzalloc(size, GFP_KERNEL);

0 commit comments

Comments
 (0)