From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-media@vger.kernel.org, prabhakar.csengg@gmail.com,
laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl,
kyungmin.park@samsung.com
Subject: Re: [PATCH RFC 3/5] V4L2: Add V4L2_ASYNC_MATCH_OF subdev matching type
Date: Thu, 25 Jul 2013 11:45:52 +0200 [thread overview]
Message-ID: <51F0F3D0.8010700@samsung.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1307241320170.30777@axis700.grange>
Hi Guennadi,
On 07/24/2013 01:21 PM, Guennadi Liakhovetski wrote:
> Hi Sylwester
>
> On Mon, 22 Jul 2013, Sylwester Nawrocki wrote:
>
>> Add support for matching by device_node pointer. This allows
>> the notifier user to simply pass a list of device_node pointers
>> corresponding to sub-devices.
>>
>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> drivers/media/v4l2-core/v4l2-async.c | 9 +++++++++
>> include/media/v4l2-async.h | 5 +++++
>> 2 files changed, 14 insertions(+)
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
>> index 86934ca..9f91013 100644
>> --- a/drivers/media/v4l2-core/v4l2-async.c
>> +++ b/drivers/media/v4l2-core/v4l2-async.c
>> @@ -39,6 +39,11 @@ static bool match_devname(struct device *dev, struct v4l2_async_subdev *asd)
>> return !strcmp(asd->match.device_name.name, dev_name(dev));
>> }
>>
>> +static bool match_of(struct device *dev, struct v4l2_async_subdev *asd)
>> +{
>> + return dev->of_node == asd->match.of.node;
>> +}
>> +
>> static LIST_HEAD(subdev_list);
>> static LIST_HEAD(notifier_list);
>> static DEFINE_MUTEX(list_lock);
>> @@ -66,6 +71,9 @@ static struct v4l2_async_subdev *v4l2_async_belongs(struct v4l2_async_notifier *
>> case V4L2_ASYNC_MATCH_I2C:
>> match = match_i2c;
>> break;
>> + case V4L2_ASYNC_MATCH_OF:
>> + match = match_of;
>> + break;
>> default:
>> /* Cannot happen, unless someone breaks us */
>> WARN_ON(true);
>> @@ -145,6 +153,7 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
>> case V4L2_ASYNC_MATCH_CUSTOM:
>> case V4L2_ASYNC_MATCH_DEVNAME:
>> case V4L2_ASYNC_MATCH_I2C:
>> + case V4L2_ASYNC_MATCH_OF:
>> break;
>> default:
>> dev_err(notifier->v4l2_dev ? notifier->v4l2_dev->dev : NULL,
>> diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
>> index 33e3b2a..295782e 100644
>> --- a/include/media/v4l2-async.h
>> +++ b/include/media/v4l2-async.h
>> @@ -13,6 +13,7 @@
>>
>> #include <linux/list.h>
>> #include <linux/mutex.h>
>> +#include <linux/of.h>
>>
>> struct device;
>> struct v4l2_device;
>
> A nitpick: it is common to just forward-declare structs as above instead
> of including a header if just a pointer to that struct is needed. I think
> it would be more consistent to update it here.
Sure, I will make this change before sending the pull request. I wasn't
really sure which way is better.
--
Regards,
Sylwester
next prev parent reply other threads:[~2013-07-25 9:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 18:04 [PATCH RFC 0/5] v4l2-async DT support improvement and cleanups Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 1/5] V4L2: Drop bus_type check in v4l2-async match functions Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 2/5] V4L2: Rename v4l2_async_bus_* to v4l2_async_match_* Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 3/5] V4L2: Add V4L2_ASYNC_MATCH_OF subdev matching type Sylwester Nawrocki
2013-07-24 11:21 ` Guennadi Liakhovetski
2013-07-25 9:45 ` Sylwester Nawrocki [this message]
2013-07-22 18:04 ` [PATCH RFC 4/5] V4L2: Rename subdev field of struct v4l2_async_notifier Sylwester Nawrocki
2013-07-23 15:50 ` Prabhakar Lad
2013-07-24 9:39 ` Sylwester Nawrocki
2013-07-24 11:26 ` Guennadi Liakhovetski
2013-07-25 9:52 ` Sylwester Nawrocki
2013-07-22 18:04 ` [PATCH RFC 5/5] V4L2: Fold struct v4l2_async_subdev_list with struct v4l2_subdev Sylwester Nawrocki
2013-07-23 15:44 ` [PATCH RFC 0/5] v4l2-async DT support improvement and cleanups Prabhakar Lad
2013-07-24 10:06 ` Laurent Pinchart
2013-07-25 9:33 ` Sylwester Nawrocki
2013-07-24 10:16 ` Hans Verkuil
2013-07-25 9:38 ` Sylwester Nawrocki
2013-07-24 11:36 ` Guennadi Liakhovetski
2013-07-25 10:01 ` 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=51F0F3D0.8010700@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=g.liakhovetski@gmx.de \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=prabhakar.csengg@gmail.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.