From: Linus Torvalds Date: Mon, 29 Oct 2018 21:29:58 +0000 (-0700) Subject: Merge tag 'media/v4.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab... X-Git-Tag: v5.4-rc1~2321 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=134bf98c5596605af90f104716ef912e8f7eb56b;p=platform%2Fkernel%2Flinux-rpi.git Merge tag 'media/v4.20-1' of git://git./linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - new dvb frontend driver: lnbh29 - new sensor drivers: imx319 and imx 355 - some old soc_camera driver renames to avoid conflict with new drivers - new i.MX Pixel Pipeline (PXP) mem-to-mem platform driver - a new V4L2 frontend for the FWHT codec - several other improvements, bug fixes, code cleanups, etc * tag 'media/v4.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (289 commits) media: rename soc_camera I2C drivers media: cec: forgot to cancel delayed work media: vivid: Support 480p for webcam capture media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSD media: vivid: Add 16-bit bayer to format list media: v4l2-tpg-core: Add 16-bit bayer media: pvrusb2: replace `printk` with `pr_*` media: venus: vdec: fix decoded data size media: cx231xx: fix potential sign-extension overflow on large shift media: dt-bindings: media: rcar_vin: add device tree support for r8a7744 media: isif: fix a NULL pointer dereference bug media: exynos4-is: make const array config_ids static media: cx23885: make const array addr_list static media: ivtv: make const array addr_list static media: bttv-input: make const array addr_list static media: cx18: Don't check for address of video_dev media: dw9807-vcm: Fix probe error handling media: dw9714: Remove useless error message media: dw9714: Fix error handling in probe function media: cec: name for RC passthrough device does not need 'RC for' ... --- 134bf98c5596605af90f104716ef912e8f7eb56b diff --cc drivers/staging/media/imx/imx-media-dev.c index 3f48f5ce,4818401..026b9cb --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@@ -80,52 -47,34 +47,43 @@@ int imx_media_add_async_subdev(struct i struct imx_media_async_subdev *imxasd; struct v4l2_async_subdev *asd; const char *devname = NULL; - int ret = 0; - - mutex_lock(&imxmd->mutex); + int ret; - if (pdev) + if (fwnode) { + asd = v4l2_async_notifier_add_fwnode_subdev( + &imxmd->notifier, fwnode, sizeof(*imxasd)); + } else { devname = dev_name(&pdev->dev); - - /* return -EEXIST if this asd already added */ - if (find_async_subdev(imxmd, fwnode, devname)) { - if (np) - dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n", - __func__, np); - else - dev_dbg(imxmd->md.dev, "%s: already added %s\n", - __func__, devname); - ret = -EEXIST; - goto out; + asd = v4l2_async_notifier_add_devname_subdev( + &imxmd->notifier, devname, sizeof(*imxasd)); } - imxasd = devm_kzalloc(imxmd->md.dev, sizeof(*imxasd), GFP_KERNEL); - if (!imxasd) { - ret = -ENOMEM; - goto out; + if (IS_ERR(asd)) { + ret = PTR_ERR(asd); - if (ret == -EEXIST) - dev_dbg(imxmd->md.dev, "%s: already added %s\n", - __func__, np ? np->name : devname); ++ if (ret == -EEXIST) { ++ if (np) ++ dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n", ++ __func__, np); ++ else ++ dev_dbg(imxmd->md.dev, "%s: already added %s\n", ++ __func__, devname); ++ } + return ret; } - asd = &imxasd->asd; - if (fwnode) { - asd->match_type = V4L2_ASYNC_MATCH_FWNODE; - asd->match.fwnode = fwnode; + imxasd = to_imx_media_asd(asd); + + if (devname) + imxasd->pdev = pdev; + - dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n", - __func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME"); ++ if (np) + dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n", + __func__, np); - } else { - asd->match_type = V4L2_ASYNC_MATCH_DEVNAME; - asd->match.device_name = devname; - imxasd->pdev = pdev; ++ else + dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n", + __func__, devname); - } - - list_add_tail(&imxasd->list, &imxmd->asd_list); - - imxmd->subdev_notifier.num_subdevs++; - out: - mutex_unlock(&imxmd->mutex); - return ret; + return 0; } /* diff --cc drivers/staging/media/imx/imx-media-of.c index 163437e,1c91754..b2e840f --- a/drivers/staging/media/imx/imx-media-of.c +++ b/drivers/staging/media/imx/imx-media-of.c @@@ -20,67 -20,13 +20,13 @@@ #include