mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Cc: "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 21:25:18 +0200	[thread overview]
Message-ID: <aWacHjLKiG0fsymG@kekkonen.localdomain> (raw)
In-Reply-To: <aWY8__K4nVs0bEWT@zed>

Hi Jacopo,

On Tue, Jan 13, 2026 at 01:43:12PM +0100, Jacopo Mondi wrote:
> 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 ?

Please. :-)

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2026-01-13 19:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13  7:57 jempty.liang
2026-01-13  8:55 ` Jacopo Mondi
2026-01-13 10:40   ` Sakari Ailus
2026-01-13 12:43     ` Jacopo Mondi
2026-01-13 19:25       ` Sakari Ailus [this message]
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=aWacHjLKiG0fsymG@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=imntjempty@163.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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®