From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, sw0312.kim@samsung.com,
Kyungmin Park <kyungmin.park@samsung.com>,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [PATCH] s5p-fimc: Fix platform entities registration
Date: Thu, 25 Oct 2012 14:42:57 +0200 [thread overview]
Message-ID: <508933D1.80308@samsung.com> (raw)
In-Reply-To: <6007649.66KylGAjOu@avalon>
Hi Laurent,
On 10/25/2012 01:35 PM, Laurent Pinchart wrote:
> On Thursday 25 October 2012 11:06:56 Sylwester Nawrocki wrote:
>> Make sure there is no v4l2_device_unregister_subdev() call
>> on a subdev which wasn't registered.
>
> I'm not implying that this fix is bad, but doesn't the V4L2 core already
> handle this ? v4l2_device_unregister_subdev() returns immediately without
> doing anything if the subdev hasn't been registered.
Indeed, the patch summary might be a bit misleading and incomplete.
I of course wanted to make sure the platform subdevs are not treated
as registered when any part of v4l2_device_register_subdev() fails.
Looking at function v4l2_device_register_subdev(), I'm wondering whether
line
159 sd->v4l2_dev = v4l2_dev;
shouldn't be moved right before
190 spin_lock(&v4l2_dev->lock);
so sd->v4l2_dev is set only if we return 0 in this function ?
Since in function v4l2_device_unregister_subdev() there is a check like
259 /* return if it isn't registered */
260 if (sd == NULL || sd->v4l2_dev == NULL)
261 return;
i.e. if subdev is not really registered, e.g. internal .registered
op fails, it should be NULL.
In my case sd wasn't null since this structure was embedded in
other one.
--
Thanks,
Sylwester
next prev parent reply other threads:[~2012-10-25 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 9:06 [PATCH] s5p-fimc: Fix platform entities registration Sylwester Nawrocki
2012-10-25 11:35 ` Laurent Pinchart
2012-10-25 12:42 ` Sylwester Nawrocki [this message]
2012-10-27 20:44 ` Sylwester Nawrocki
2012-10-25 14:07 ` Sylwester Nawrocki
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=508933D1.80308@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sw0312.kim@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.