From: Mark Brown <broonie@kernel.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hverkuil+cisco@kernel.org>,
Kees Cook <kees@kernel.org>, Kees Cook <kees+treewide@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>
Subject: linux-next: manual merge of the v4l-dvb tree with the origin tree
Date: Mon, 16 Nov 2026 16:36:18 +0000 [thread overview]
Message-ID: <avsxAvgy5sbJWl4y@sirena.org.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 4807 bytes --]
Hi all,
Today's linux-next merge of the v4l-dvb tree got a conflict in:
drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
between commit:
4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")
from the origin tree and commit:
03ec4aa9817b2 ("media: synopsys: hdmirx: free the driver data when the last user is gone")
from the v4l-dvb tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --combined drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
index 713aa95be8179,a241761b1bcd9..0000000000000
--- a/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@@ -678,13 -678,9 +678,9 @@@ static void hdmirx_plugout(struct snps_
hdmirx_writel(hdmirx_dev, PHYCREG_CONFIG0, 0x0);
cancel_delayed_work(&hdmirx_dev->delayed_work_res_change);
- /* will be NULL on driver removal */
- if (hdmirx_dev->rgb_range)
- v4l2_ctrl_s_ctrl(hdmirx_dev->rgb_range, V4L2_DV_RGB_RANGE_AUTO);
-
- if (hdmirx_dev->content_type)
- v4l2_ctrl_s_ctrl(hdmirx_dev->content_type,
- V4L2_DV_IT_CONTENT_TYPE_NO_ITC);
+ v4l2_ctrl_s_ctrl(hdmirx_dev->rgb_range, V4L2_DV_RGB_RANGE_AUTO);
+ v4l2_ctrl_s_ctrl(hdmirx_dev->content_type,
+ V4L2_DV_IT_CONTENT_TYPE_NO_ITC);
hdmirx_dev->plugged = false;
}
@@@ -2941,6 -2937,16 +2937,16 @@@ static int hdmirx_register_audio_device
return 0;
}
+ /* Runs when the last user of a device node is gone, possibly after remove() */
+ static void hdmirx_v4l2_release(struct v4l2_device *v4l2_dev)
+ {
+ struct snps_hdmirx_dev *hdmirx_dev =
+ container_of(v4l2_dev, struct snps_hdmirx_dev, v4l2_dev);
+
+ v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
+ kfree(hdmirx_dev);
+ }
+
static int hdmirx_probe(struct platform_device *pdev)
{
struct snps_hdmirx_dev *hdmirx_dev;
@@@ -2950,7 -2956,7 +2956,7 @@@
struct v4l2_device *v4l2_dev;
int ret;
- hdmirx_dev = devm_kzalloc_obj(dev, *hdmirx_dev);
+ hdmirx_dev = kzalloc_obj(*hdmirx_dev);
if (!hdmirx_dev)
return -ENOMEM;
@@@ -2960,23 -2966,25 +2966,25 @@@
*/
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
- return ret;
+ goto err_free;
hdmirx_dev->dev = dev;
dev_set_drvdata(dev, hdmirx_dev);
ret = hdmirx_parse_dt(hdmirx_dev);
if (ret)
- return ret;
+ goto err_free;
ret = hdmirx_setup_irq(hdmirx_dev, pdev);
if (ret)
- return ret;
+ goto err_free;
hdmirx_dev->regs = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(hdmirx_dev->regs))
- return dev_err_probe(dev, PTR_ERR(hdmirx_dev->regs),
- "failed to remap regs resource\n");
+ if (IS_ERR(hdmirx_dev->regs)) {
+ ret = dev_err_probe(dev, PTR_ERR(hdmirx_dev->regs),
+ "failed to remap regs resource\n");
+ goto err_free;
+ }
mutex_init(&hdmirx_dev->phy_rw_lock);
mutex_init(&hdmirx_dev->stream_lock);
@@@ -3031,11 -3039,12 +3039,12 @@@
goto err_pm;
}
hdmirx_dev->v4l2_dev.ctrl_handler = hdl;
+ hdmirx_dev->v4l2_dev.release = hdmirx_v4l2_release;
ret = v4l2_device_register(dev, &hdmirx_dev->v4l2_dev);
if (ret < 0) {
dev_err_probe(dev, ret, "v4l2 device registration failed\n");
- goto err_hdl;
+ goto err_pm;
}
stream = &hdmirx_dev->stream;
@@@ -3071,10 -3080,16 +3080,16 @@@ err_unreg_video_dev
vb2_video_unregister_device(&hdmirx_dev->stream.vdev);
err_unreg_v4l2_dev:
v4l2_device_unregister(&hdmirx_dev->v4l2_dev);
- err_hdl:
- v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
+ hdmirx_disable(dev);
+ v4l2_device_put(&hdmirx_dev->v4l2_dev);
+
+ return ret;
+
err_pm:
hdmirx_disable(dev);
+ v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
+ err_free:
+ kfree(hdmirx_dev);
return ret;
}
@@@ -3095,16 -3110,13 +3110,13 @@@ static void hdmirx_remove(struct platfo
hdmirx_disable_irq(dev);
vb2_video_unregister_device(&hdmirx_dev->stream.vdev);
- v4l2_ctrl_handler_free(&hdmirx_dev->hdl);
v4l2_device_unregister(&hdmirx_dev->v4l2_dev);
- /* touched by hdmirx_disable()->hdmirx_plugout() */
- hdmirx_dev->rgb_range = NULL;
- hdmirx_dev->content_type = NULL;
-
hdmirx_disable(dev);
reset_control_bulk_assert(HDMIRX_NUM_RST, hdmirx_dev->resets);
+
+ v4l2_device_put(&hdmirx_dev->v4l2_dev);
}
static const struct of_device_id hdmirx_id[] = {
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2026-11-16 16:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 16:36 Mark Brown [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-11-12 13:58 Mark Brown
2026-06-03 13:33 Mark Brown
2026-06-02 16:16 Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avsxAvgy5sbJWl4y@sirena.org.uk \
--to=broonie@kernel.org \
--cc=hverkuil+cisco@kernel.org \
--cc=kees+treewide@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®