Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org, Helen Koike <helen.koike@collabora.com>
Subject: Re: [PATCHv4 7/9] vimc: zero the media_device on probe
Date: Fri, 8 Mar 2019 16:09:09 +0200	[thread overview]
Message-ID: <20190308140909.GL4802@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190308135625.11278-8-hverkuil-cisco@xs4all.nl>

Hi Hans,

Thank you for the patch.

On Fri, Mar 08, 2019 at 02:56:23PM +0100, Hans Verkuil wrote:
> The media_device is part of a static global vimc_device struct.
> The media framework expects this to be zeroed before it is
> used, however, since this is a global this is not the case if
> vimc is unbound and then bound again.
> 
> So call memset to ensure any left-over values are cleared.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Do I recall correctly that you mentioned there's work in progress that
will allocate this dynamically ? If so feel free to mention it in the
commit message if you want.

> ---
>  drivers/media/platform/vimc/vimc-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
> index 0fbb7914098f..3aa62d7e3d0e 100644
> --- a/drivers/media/platform/vimc/vimc-core.c
> +++ b/drivers/media/platform/vimc/vimc-core.c
> @@ -304,6 +304,8 @@ static int vimc_probe(struct platform_device *pdev)
>  
>  	dev_dbg(&pdev->dev, "probe");
>  
> +	memset(&vimc->mdev, 0, sizeof(vimc->mdev));
> +
>  	/* Create platform_device for each entity in the topology*/
>  	vimc->subdevs = devm_kcalloc(&vimc->pdev.dev, vimc->pipe_cfg->num_ents,
>  				     sizeof(*vimc->subdevs), GFP_KERNEL);

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2019-03-08 14:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 13:56 [PATCHv4 0/9] Various core and virtual driver fixes Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 1/9] cec: fill in cec chardev kobject to ease debugging Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 2/9] media-devnode: fill in media " Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 3/9] vivid: use vzalloc for dev->bitmap_out Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 4/9] vim2m: replace devm_kzalloc by kzalloc Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 5/9] v4l2-subdev: add release() internal op Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 6/9] v4l2-subdev: handle module refcounting here Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 7/9] vimc: zero the media_device on probe Hans Verkuil
2019-03-08 14:09   ` Laurent Pinchart [this message]
2019-03-08 14:13     ` Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 8/9] vimc: free vimc_cap_device when the last user disappears Hans Verkuil
2019-03-08 13:56 ` [PATCHv4 9/9] vimc: use new release op Hans Verkuil
2019-03-11 12:34   ` [PATCHv4.1 " Hans Verkuil

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=20190308140909.GL4802@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=helen.koike@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.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