From: Alexey Klimov <klimov.linux@gmail.com>
To: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Cc: linux-media@vger.kernel.org, linux-omap@vger.kernel.org,
saaguirre@ti.com, tuukka.o.toivonen@nokia.com,
dongsoo.kim@gmail.com
Subject: Re: [PATCH 9/9] omap34xxcam: Add camera driver
Date: Sat, 07 Mar 2009 17:38:17 +0300 [thread overview]
Message-ID: <1236436697.1863.21.camel@tux.localhost> (raw)
In-Reply-To: <49AFDD0B.80804@maxwell.research.nokia.com>
Hello, Sakari Ailus
On Thu, 2009-03-05 at 16:09 +0200, Sakari Ailus wrote:
> Alexey Klimov wrote:
> >> +static int vidioc_g_fmt_vid_cap(struct file *file, void *fh,
> >> + struct v4l2_format *f)
> >> +{
> >> + struct omap34xxcam_fh *ofh = fh;
> >> + struct omap34xxcam_videodev *vdev = ofh->vdev;
> >> +
> >> + if (vdev->vdev_sensor == v4l2_int_device_dummy())
> >> + return -EINVAL;
> >> +
> >> + mutex_lock(&vdev->mutex);
> >> + f->fmt.pix = vdev->pix;
> >> + mutex_unlock(&vdev->mutex);
> >
> > Hmmmm, you are using mutex_lock to lock reading from vdev structure..
> > Well, i don't if this is right approach. I am used to that mutex_lock is
> > used to prevent _changing_ of members in structure..
>
> The vdev->mutex is acquired since we want to prevent concurrent access
> to vdev->pix. Otherwise it might change while we are reading it, right?
I thought more about this and looks like that i was wrong. You are
right. You are reading structure, and i wasn't able to notice that first
time. Sorry for bothering about this.
<snip>
> >> +static int omap34xxcam_device_register(struct v4l2_int_device *s)
> >> +{
> >> + struct omap34xxcam_videodev *vdev = s->u.slave->master->priv;
> >> + struct omap34xxcam_hw_config hwc;
> >> + int rval;
> >> +
> >> + /* We need to check rval just once. The place is here. */
> >
> > I didn't understand this comment. You doing nothin in next few lines
> > with int variable rval(which introduced in this function). Is comment
> > talking about struct v4l2_int_device *s ?
>
> Yes. If the g_priv() succeeds now it will succeed in future, too. This
> comes from the platform data through the slave device.
Well, okay. I mean that for me this comment looks ambiguous. Please, if
you don't mind it's better not to use word "rval" because it creates
confusion with int rval;.
--
Best regards, Klimov Alexey
next prev parent reply other threads:[~2009-03-07 14:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 10:06 [RFC 0/9] OMAP3 ISP and camera drivers Sakari Ailus
2009-03-03 10:06 ` [PATCH 1/9] omap3isp: Add ISP main driver and register definitions Sakari Ailus
2009-03-03 10:06 ` [PATCH 2/9] omap3isp: Add ISP MMU wrapper Sakari Ailus
2009-03-03 10:06 ` [PATCH 3/9] omap3isp: Add userspace header Sakari Ailus
2009-03-03 10:06 ` [PATCH 4/9] omap3isp: Add ISP frontend (CCDC) Sakari Ailus
2009-03-03 10:06 ` [PATCH 5/9] omap3isp: Add ISP backend (PRV and RSZ) Sakari Ailus
2009-03-03 10:06 ` [PATCH 6/9] omap3isp: Add statistics collection modules (H3A and HIST) Sakari Ailus
2009-03-03 10:06 ` [PATCH 7/9] omap3isp: Add CSI2 interface support Sakari Ailus
2009-03-03 10:06 ` [PATCH 8/9] omap3isp: Add ISP tables Sakari Ailus
2009-03-03 10:06 ` [PATCH 9/9] omap34xxcam: Add camera driver Sakari Ailus
2009-03-03 17:31 ` Alexey Klimov
2009-03-05 14:09 ` Sakari Ailus
2009-03-07 14:38 ` Alexey Klimov [this message]
2009-03-03 12:23 ` [PATCH 5/9] omap3isp: Add ISP backend (PRV and RSZ) Alexey Klimov
2009-03-03 12:07 ` [PATCH 4/9] omap3isp: Add ISP frontend (CCDC) Alexey Klimov
2009-03-06 12:51 ` [PATCH 3/9] omap3isp: Add userspace header Hans Verkuil
2009-03-03 11:56 ` [PATCH 1/9] omap3isp: Add ISP main driver and register definitions Alexey Klimov
2009-03-05 11:34 ` Sakari Ailus
2009-03-07 15:25 ` Alexey Klimov
2009-03-03 13:09 ` [RFC 0/9] OMAP3 ISP and camera drivers Sakari Ailus
2009-03-04 15:28 ` Hiremath, Vaibhav
2009-03-04 15:38 ` Sakari Ailus
2009-03-05 0:10 ` DongSoo(Nathaniel) Kim
2009-03-05 3:53 ` Hiremath, Vaibhav
2009-03-05 4:54 ` DongSoo(Nathaniel) Kim
2009-03-05 7:30 ` Sakari Ailus
2009-03-05 14:26 ` [PATCH] omap34xxcam: Don't use dev_err before we have a video device Sakari Ailus
2009-03-05 5:00 ` [RFC 0/9] OMAP3 ISP and camera drivers DongSoo(Nathaniel) Kim
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=1236436697.1863.21.camel@tux.localhost \
--to=klimov.linux@gmail.com \
--cc=dongsoo.kim@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=saaguirre@ti.com \
--cc=sakari.ailus@maxwell.research.nokia.com \
--cc=tuukka.o.toivonen@nokia.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