From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
"jempty.liang" <imntjempty@163.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
dan.scally@ideasonboard.com, mchehab@kernel.org,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: mali-c55: Fix NULL dev stream alert for tpg sub-device
Date: Tue, 13 Jan 2026 13:43:12 +0100 [thread overview]
Message-ID: <aWY8__K4nVs0bEWT@zed> (raw)
In-Reply-To: <aWYhGQcDVRDTyvxj@kekkonen.localdomain>
Hi Sakari
On Tue, Jan 13, 2026 at 12:40:25PM +0200, Sakari Ailus wrote:
> Hi Jacopo,
>
> On Tue, Jan 13, 2026 at 09:55:10AM +0100, Jacopo Mondi wrote:
> > I wonder if v4l2_device_register_subdev() shouldn't WARN or if return
> > an error if sd->dev is not initialized. Laurent, Sakari: opinions ?
>
> I might even return an error but I wonder what would break. Perhaps indeed
> could start with a warning?
I would start with:
--- a/drivers/media/v4l2-core/v4l2-device.c
+++ b/drivers/media/v4l2-core/v4l2-device.c
@@ -117,6 +117,13 @@ int __v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
if (!v4l2_dev || !sd || sd->v4l2_dev || !sd->name[0])
return -EINVAL;
+ /*
+ * Initializing sd->dev is mandatory. Warn for now to give faulty
+ * drivers a bit of time to update before actually returning an error.
+ */
+ WARN_ON(!sd->dev);
+
/*
* The reason to acquire the module here is to avoid unloading
* a module of sub-device which is registered to a media
Would you like a patch ?
>
> --
> Sakari Ailus
next prev parent reply other threads:[~2026-01-13 12:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 7:57 [PATCH] media: mali-c55: Fix NULL dev stream alert for tpg sub-device jempty.liang
2026-01-13 8:55 ` Jacopo Mondi
2026-01-13 10:40 ` Sakari Ailus
2026-01-13 12:43 ` Jacopo Mondi [this message]
2026-01-13 19:25 ` Sakari Ailus
2026-01-13 14:12 ` Dan Scally
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=aWY8__K4nVs0bEWT@zed \
--to=jacopo.mondi@ideasonboard.com \
--cc=dan.scally@ideasonboard.com \
--cc=imntjempty@163.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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